Browse Source

renamed to gocqldriver, added deprecation warning

Christoph Hack 12 years ago
parent
commit
ebe630bd36
4 changed files with 19 additions and 15 deletions
  1. 13 8
      README.md
  2. 2 2
      convert.go
  3. 1 1
      gocql.go
  4. 3 4
      gocql_test.go

+ 13 - 8
README.md

@@ -1,7 +1,11 @@
-gocql
-=====
+gocqldriver (DEPRECATED)
+========================
 
 
-The gocql package provides a database/sql driver for CQL, the Cassandra
+**DEPRECATED:** This package is no longer maintained because the
+`database/sql` API wasn't a good fit for Cassandra. An actively devloped,
+full featured Cassandra client can be found here: https://github.com/tux21b/gocql
+
+The gocqldriver package provides a database/sql driver for CQL, the Cassandra
 query language.
 query language.
 
 
 This package requires a recent version of Cassandra (≥ 1.2) that supports
 This package requires a recent version of Cassandra (≥ 1.2) that supports
@@ -9,15 +13,16 @@ CQL 3.0 and the new native protocol. The native protocol is still considered
 beta and must be enabled manually in Cassandra 1.2 by setting
 beta and must be enabled manually in Cassandra 1.2 by setting
 "start_native_transport" to true in conf/cassandra.yaml.
 "start_native_transport" to true in conf/cassandra.yaml.
 
 
-**Note:** gocql requires the tip version of Go, as some changes in the 
-`database/sql` have not made it into 1.0.x yet. There is 
-[a fork](https://github.com/titanous/gocql) that backports these changes 
+**Note:** gocqldriver requires the tip version of Go, as some changes in the
+`database/sql` have not made it into 1.0.x yet. There is
+[a fork](https://github.com/titanous/gocql) that backports these changes
 to Go 1.0.3.
 to Go 1.0.3.
 
 
+
 Installation
 Installation
 ------------
 ------------
 
 
-    go get github.com/tux21b/gocql
+    go get github.com/tux21b/gocqldriver
 
 
 Example
 Example
 -------
 -------
@@ -28,7 +33,7 @@ package main
 import (
 import (
 	"database/sql"
 	"database/sql"
 	"fmt"
 	"fmt"
-	_ "github.com/tux21b/gocql"
+	_ "github.com/tux21b/gocqldriver"
 )
 )
 
 
 func main() {
 func main() {

+ 2 - 2
convert.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-package gocql
+package gocqldriver
 
 
 import (
 import (
 	"database/sql/driver"
 	"database/sql/driver"
@@ -50,7 +50,7 @@ func decode(b []byte, t uint16) driver.Value {
 		return b
 		return b
 	case typeInt:
 	case typeInt:
 		return int64(int32(binary.BigEndian.Uint32(b)))
 		return int64(int32(binary.BigEndian.Uint32(b)))
-	case typeBigInt, typeCounter :
+	case typeBigInt, typeCounter:
 		return int64(binary.BigEndian.Uint64(b))
 		return int64(binary.BigEndian.Uint64(b))
 	case typeFloat:
 	case typeFloat:
 		return float64(math.Float32frombits(binary.BigEndian.Uint32(b)))
 		return float64(math.Float32frombits(binary.BigEndian.Uint32(b)))

+ 1 - 1
gocql.go

@@ -26,7 +26,7 @@
 //         // ...
 //         // ...
 //     }
 //     }
 //
 //
-package gocql
+package gocqldriver
 
 
 import (
 import (
 	"bytes"
 	"bytes"

+ 3 - 4
gocql_test.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-package gocql
+package gocqldriver
 
 
 import (
 import (
 	"bytes"
 	"bytes"
@@ -176,7 +176,6 @@ func TestTypes(t *testing.T) {
 	}
 	}
 }
 }
 
 
-
 func TestNullColumnValues(t *testing.T) {
 func TestNullColumnValues(t *testing.T) {
 	db, err := sql.Open("gocql", "localhost:9042 compression=snappy")
 	db, err := sql.Open("gocql", "localhost:9042 compression=snappy")
 	if err != nil {
 	if err != nil {
@@ -214,8 +213,8 @@ func TestNullColumnValues(t *testing.T) {
 	var data1 []byte
 	var data1 []byte
 	var data2 []byte
 	var data2 []byte
 	if rows, err := db.Query(`SELECT id, subid, foo, bar FROM stuff`); err == nil {
 	if rows, err := db.Query(`SELECT id, subid, foo, bar FROM stuff`); err == nil {
-			for rows.Next() {
-					if err := rows.Scan(&rid, &sid, &data1, &data2); err != nil {
+		for rows.Next() {
+			if err := rows.Scan(&rid, &sid, &data1, &data2); err != nil {
 				t.Error(err)
 				t.Error(err)
 			}
 			}
 		}
 		}