Skip to content

Commit

Permalink
Merge pull request apache#235 from psankar/master
Browse files Browse the repository at this point in the history
Some inline code comments for beginners
  • Loading branch information
0x6e6562 committed Aug 20, 2014
2 parents f35c807 + dc2da1c commit 4b86114
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ Ben Frye <benfrye@gmail.com>
Fred McCann <fred@sharpnoodles.com>
Dan Simmons <dan@simmons.io>
Muir Manders <muir@retailnext.net>
Sankar P <sankar.curiosity@gmail.com>
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ Example
-------

```go
/* Before you execute the program, Launch `cqlsh` and execute:
create keyspace example with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
create table example.tweet(timeline text, id UUID, text text, PRIMARY KEY(id));
create index on example.tweet(timeline);
*/
package main

import (
Expand All @@ -112,7 +117,9 @@ func main() {
var id gocql.UUID
var text string

// select a single tweet
/* Search for a specific set of records whose 'timeline' column matches
* the value 'me'. The secondary index that we created earlier will be
* used for optimizing the search */
if err := session.Query(`SELECT id, text FROM tweet WHERE timeline = ? LIMIT 1`,
"me").Consistency(gocql.One).Scan(&id, &text); err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 4b86114

Please sign in to comment.