Skip to content
Browse files

Account for CQL3 changes in Readme, see #42

- Change example to be CQL 3 compliant.
- Don't mention %s as placeholder any more (since it wouldn't be
  compatible with CQL 3 prepared statements).
- Also mention that you cannot use placeholders for Column names
  • Loading branch information...
1 parent a972941 commit df0296bf4e5774ba094e1f50b8dbe37e40e623ca @ctavan ctavan committed May 7, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 Readme.md
View
7 Readme.md
@@ -36,7 +36,7 @@
user : 'test',
password : 'test1233',
timeout : 3000
- //cqlVersion : '3.0.0' // specify this if you're using Cassandra 1.1
+ //cqlVersion : '3.0.0' // specify this if you're using Cassandra 1.1 and want to use CQL 3
});
//if you don't listen for error, it will bubble up to `process.uncaughtException`
@@ -58,14 +58,13 @@
//for formatting specific see `http://nodejs.org/docs/latest/api/util.html#util.format`
//results is an array of row objects
- pool.cql("SELECT '%s' FROM cf_one WHERE key='%s'", ['col','key123'], function(err, results){
+ pool.cql("SELECT col FROM cf_one WHERE key = ?", ['key123'], function(err, results){
console.log(err, results);
});
//NOTE:
- //- You can also use ? as a placeholder. eg: "SELECT ? FROM cf_one WHERE key = ?"
//- You can always skip quotes around placeholders, they are added automatically.
- //- You cannot use placeholders for ColumnFamily names.
+ //- In CQL 3 you cannot use placeholders for ColumnFamily names or Column names.
}
});
```

0 comments on commit df0296b

Please sign in to comment.
Something went wrong with that request. Please try again.