0

Using Datastax - Cassandra PHP Driver, I would like execute CQL script file. For example, this script file contain many CREATE KEYSPACE,CREATE TABLE commands.

In cqlsh terminal, I can do the above thing by

cqlsh>source 'script_name.cql';

But, How I can acheive the same through Datastax - Cassandra PHP Driver?

Any help is appreciated.

ArK
  • 20,698
  • 67
  • 109
  • 136
JsLearner
  • 446
  • 2
  • 7
  • 17

1 Answers1

1

There is no such API in driver. Same can be achieved through:

  1. If cql is installed on the server where php is being run, then use exec(cqlsh [ other optional options ] -f script_name.cql).
  2. Read the file in PHP code and execute the command.
undefined_variable
  • 6,180
  • 2
  • 22
  • 37