The NodeJS cassandra driver offers automatic & safe type conversion for prepared queries.
This is great for simpler code that doesn't have to convert strings to UUID types, dates, etc.
Ex:
cql_client.execute(
'SELECT * FROM keyspace.sample_table where "id" = ?;',
[ 'd8160520-5f6d-11eb-af42-0a1f69b793a6'],
{ prepare : true }
).then(dat => {console.log(`results obtained: ${dat.length}`); }
).catch(error => console.log(`got error ${error}`));
Express Cassandra prepares all queries by default, so I expected this feature to be available.
But when I try to query with a string UUID instead of a UUID type, I get an error because string isn't a UUID type. The error is thrown by lib/utils/parser.js get_db_value_expression(). This forces me to write queries like models.datatypes.Uuid.fromString(id) instead of id.
Is there some way to bypass that type checking? If not, would you consider supporting that feature?
The NodeJS cassandra driver offers automatic & safe type conversion for prepared queries.
This is great for simpler code that doesn't have to convert strings to UUID types, dates, etc.
Ex:
Express Cassandra prepares all queries by default, so I expected this feature to be available.
But when I try to query with a string UUID instead of a UUID type, I get an error because string isn't a UUID type. The error is thrown by lib/utils/parser.js
get_db_value_expression(). This forces me to write queries likemodels.datatypes.Uuid.fromString(id)instead ofid.Is there some way to bypass that type checking? If not, would you consider supporting that feature?