Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
Account for CQL3 changes in Readme, see #42
Browse files Browse the repository at this point in the history
- 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
ctavan committed May 7, 2012
1 parent a972941 commit df0296b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Readme.md
Expand Up @@ -36,7 +36,7 @@
user : 'test', user : 'test',
password : 'test1233', password : 'test1233',
timeout : 3000 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` //if you don't listen for error, it will bubble up to `process.uncaughtException`
Expand All @@ -58,14 +58,13 @@
//for formatting specific see `http://nodejs.org/docs/latest/api/util.html#util.format` //for formatting specific see `http://nodejs.org/docs/latest/api/util.html#util.format`
//results is an array of row objects //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); console.log(err, results);
}); });


//NOTE: //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 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.
} }
}); });
``` ```
Expand Down

0 comments on commit df0296b

Please sign in to comment.