Simply put, I have a cql script I would like to submit to a cluster via the cassandra Session
, without having to go through cqlsh.
I've looked through their API and I don't see anything to take in a CQL script, or a way to parse a script into Statement
s that could be fed into a cassandra Session
.
I suppose I could write something that parses the script myself but surely that must exist already somewhere in the datastax code.
A modern, feature-rich and highly tunable Node. js client library for Apache Cassandra and DSE using exclusively Cassandra's binary protocol and Cassandra Query Language.
I haven't noticed a function to execute a script, but you could write a little loop to read in your script line by line and call:
session.execute(cql_line);
Where cql_line
is a string containing a CQL statement. As long as your script has a complete CQL statement on each line you wouldn't need to do any parsing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With