The application will be run against an existing database. First, I verify that the database does not have MyTable
:
$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.3 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> use rebar;
cqlsh:rebar> describe tables;
"Compendium" "Translaticiarum" "AccountVerificationRequest"
"ExhibitionItemImage" logs "ToDo"
"Villa" "ExhibitionItem" "User"
"UserPassportIdentity" "AccountConfirmation"
"RBPaymentsPaymentMethod" "Ensayo"
cqlsh:rebar> exit
Then I start the server that will execute the code above. Notice the last two lines are from the console.log
statements executed upon success:
$ npm run dev-server
> [email protected] dev-server /Users/alex/Documents/Projects/Rebar
> better-npm-run dev-server
running better-npm-run in /Users/alex/Documents/Projects/Rebar
Executing script: dev-server
to be executed: nodemon --exec ./node_modules/.bin/babel-node -- ./server/server.js
[nodemon] 1.10.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `./node_modules/.bin/babel-node ./server/server.js`
{ name: 'urb',
version: '7.6.4.50',
NODE_ENV: 'development',
HOST: 'localhost',
PORT: '4444',
PUBLIC_URL: 'http://localhost:4444',
process_title: '/usr/local/bin/node',
process_pid: 3551,
local_ip: '192.168.1.71',
objectPersistence: 'cassandra',
CASSANDRA_KEYSPACE: 'rebar',
CASSANDRA_CONNECTION_POINTS: '127.0.0.1' }
{ [Function]
super_:
{ [Function]
_properties: { name: null, schema: null },
_set_properties: [Function],
_validate: [Function],
_get_validators: [Function],
_ensure_connected: [Function],
_execute_definition_query: [Function],
_execute_batch: [Function],
execute_batch: [Function],
get_cql_client: [Function],
_create_table: [Function],
_create_table_query: [Function],
_create_materialized_view_query: [Function],
_create_index_query: [Function],
_create_custom_index_query: [Function],
_get_db_table_schema: [Function],
_execute_table_query: [Function],
_get_db_value_expression: [Function],
_create_where_clause: [Function],
_create_find_query: [Function],
get_table_name: [Function],
is_table_ready: [Function],
init: [Function],
syncDefinition: [Function],
execute_query: [Function],
execute_eachRow: [Function],
_execute_table_eachRow: [Function],
eachRow: [Function],
execute_stream: [Function],
_execute_table_stream: [Function],
stream: [Function],
find: [Function],
findOne: [Function],
update: [Function],
delete: [Function],
drop_mviews: [Function],
drop_table: [Function] },
_properties:
{ name: 'mytable',
schema: { fields: [Object], key: [Object] },
keyspace: 'rebar',
define_connection:
Client {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: 0,
options: [Object],
connected: false,
isShuttingDown: false,
keyspace: 'rebar',
metadata: [Object],
hosts: null },
cql:
Client {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: 0,
options: [Object],
connected: false,
isShuttingDown: false,
keyspace: 'rebar',
metadata: [Object],
hosts: null },
get_constructor: [Function: bound ],
connect: [Function: bound ],
dropTableOnSchemaChange: false,
table_name: 'mytable',
qualified_table_name: '"rebar".mytable' },
_set_properties: [Function],
_validate: [Function],
_get_validators: [Function],
_ensure_connected: [Function],
_execute_definition_query: [Function],
_execute_batch: [Function],
execute_batch: [Function],
get_cql_client: [Function],
_create_table: [Function],
_create_table_query: [Function],
_create_materialized_view_query: [Function],
_create_index_query: [Function],
_create_custom_index_query: [Function],
_get_db_table_schema: [Function],
_execute_table_query: [Function],
_get_db_value_expression: [Function],
_create_where_clause: [Function],
_create_find_query: [Function],
get_table_name: [Function],
is_table_ready: [Function],
init: [Function],
syncDefinition: [Function],
execute_query: [Function],
execute_eachRow: [Function],
_execute_table_eachRow: [Function],
eachRow: [Function],
execute_stream: [Function],
_execute_table_stream: [Function],
stream: [Function],
find: [Function],
findOne: [Function],
update: [Function],
delete: [Function],
drop_mviews: [Function],
drop_table: [Function] }
true
^C
$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.3 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> use rebar;
cqlsh:rebar> describe tables;
"Compendium" "Translaticiarum" "Ensayo"
"ExhibitionItemImage" mytable "AccountVerificationRequest"
"Villa" logs "ToDo"
"UserPassportIdentity" "ExhibitionItem" "User"
"RBPaymentsPaymentMethod" "AccountConfirmation"
cqlsh:rebar> describe table mytable;
CREATE TABLE rebar.mytable (
"MyTable_Name" text PRIMARY KEY,
"MyTable_Password" text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
cqlsh:rebar>
Notice that capitalization is successfully preserved in field names, but not in table names.
Would it be a big change to add support for table names with capital letters? Seems like it has already been done for the field names and from my knowledge of CQL it would seem it's mostly a matter of adding double quotes around the name like "MyTable"
.