Created
February 8, 2017 20:41
-
-
Save mpenick/c83beaf3241d83fff60fc7d86d87d4cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| $cluster = Cassandra::cluster() | |
| ->build(); | |
| $session = $cluster->connect(); | |
| $session->execute("CREATE KEYSPACE IF NOT EXISTS test WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': '3' }"); | |
| $session->execute(new Cassandra\SimpleStatement("CREATE TABLE IF NOT EXISTS test.test (key int PRIMARY KEY, value 'LexicalUUIDType')")); | |
| $session->close(); | |
| $schema = $session->schema(); | |
| $table = $schema->keyspace("test")->table("test"); | |
| foreach ($table->columns() as $column) { | |
| $type = $column->type(); | |
| echo $type . PHP_EOL; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment