Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created April 15, 2018 19:21
Show Gist options
  • Save lankydan/bbf8bda5bbe4fc9e9c87b5b11c1a4a36 to your computer and use it in GitHub Desktop.
Save lankydan/bbf8bda5bbe4fc9e9c87b5b11c1a4a36 to your computer and use it in GitHub Desktop.
Datastax driver - create table
private void createTable(Session session) {
session.execute(
SchemaBuilder.createTable(TABLE)
.ifNotExists()
.addPartitionKey("country", text())
.addClusteringColumn("first_name", text())
.addClusteringColumn("last_name", text())
.addClusteringColumn("id", uuid())
.addColumn("age", cint())
.addColumn("profession", text())
.addColumn("salary", cint()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment