Created
April 15, 2018 19:21
-
-
Save lankydan/bbf8bda5bbe4fc9e9c87b5b11c1a4a36 to your computer and use it in GitHub Desktop.
Datastax driver - create table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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