From 840f25aec9ca0ba8af413f9b14ac60f4996bf748 Mon Sep 17 00:00:00 2001 From: Bulat Shakirzyanov Date: Wed, 29 Oct 2014 10:05:07 -0700 Subject: [PATCH] [ci skip] add link to types table --- features/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/README.md b/features/README.md index 5182d5c2a..b122a49ca 100644 --- a/features/README.md +++ b/features/README.md @@ -37,7 +37,7 @@ For queries that will be run repeatedly, [you should use Prepared statements](#p ## Parameterized queries -If you're using Cassandra 2.0 or later you no longer have to build CQL strings when you want to insert a value in a query, there's a new feature that lets you bind values with reqular statements: +If you're using Cassandra 2.0 or later you no longer have to build CQL strings when you want to insert a value in a query, there's a new feature that lets you bind values with regular statements: ```ruby session.execute("UPDATE users SET age = ? WHERE user_name = ?", 41, 'Sam') @@ -45,7 +45,7 @@ session.execute("UPDATE users SET age = ? WHERE user_name = ?", 41, 'Sam') If you find yourself doing this often, it's better to use prepared statements. As a rule of thumb, if your application is sending a request more than once, a prepared statement is almost always the right choice. -When you use bound values with regular statements the type of the values has to be guessed. Cassandra supports multiple different numeric types, but there's no reliable way of guessing whether or not a Ruby `Fixnum` should be encoded as a `BIGINT` or `INT`, or whether a Ruby `Float` is a `DOUBLE` or `FLOAT`. When there are multiple choices the encoder will pick the larger type (e.g. `BIGINT` over `INT`). For Ruby strings it will always guess `VARCHAR`, never `BLOB`. +When you use bound values with regular statements the type of the values has to be guessed. Cassandra supports multiple different numeric types, but there's no reliable way of guessing whether or not a Ruby `Fixnum` should be encoded as a `BIGINT` or `INT`, or whether a Ruby `Float` is a `DOUBLE` or `FLOAT`. When there are multiple choices the encoder will pick the larger type (e.g. `BIGINT` over `INT`). For Ruby strings it will always guess `VARCHAR`, never `BLOB`. [Check out this types mapping table for additional details](http://datastax.github.io/ruby-driver/features/basics/#ruby-objects-to-from-apache-cassandra-datatypes). ## Executing Statements in Parallel @@ -423,4 +423,4 @@ Compression works best for large requests, so if you use batching you should ben [1]: https://github.com/apache/cassandra/blob/cassandra-2.0/doc/cql3/CQL.textile [2]: http://www.datastax.com/documentation/cql/3.1/webhelp/index.html - [3]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v2.spec \ No newline at end of file + [3]: https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v2.spec