exp:expcassandraimport
Import the tables of an Apache Cassandra or ScyllaDB keyspace into the site's database or a data table connection.
Script bin/php/expcassandraimport.php, code in kernel/private/classes/commands/expcassandraimport.php. Run it from the installation root, as the user the web server runs as:
./console exp:expcassandraimport --help
./console exp:cassandra:import --help
php bin/php/expcassandraimport.php --helpHelp text
Import the tables of an Apache Cassandra or ScyllaDB keyspace into a database of this installation
Reads the keyspace through CQL (PHP 8.1 and the library mroosz/php-cassandra), makes the tables in the
site's database or in a data table connection (--connection), and copies the rows page by page. The
source is a data table connection of the engine cassandra or scylladb (--source), or a server named here.
Without --apply it shows the tables it would make and does nothing.
./console exp:cassandra:import --source=events --list
./console exp:cassandra:import --source=events --prefix=ev_
./console exp:cassandra:import --server=cass1,cass2 --keyspace=shop --user=reader --secret=env:CASSANDRA_PASSWORD --apply
./console exp:cassandra:import --source=events --tables=orders --connection=archive --mode=replace --apply --format=json
Exit code: 0 done (or planned); 1 a table or row failed; 2 wrong options or no connection.Options
| Option | Value | Help |
|---|---|---|
--list | List the tables of the keyspace with their columns, and stop | |
--apply | Make the tables and copy the rows (without it: show the plan only) | |
--dry-run | Show the plan only (the default) | |
--source | required | The data table connection to read (engine cassandra or scylladb) |
--engine | required | Without --source: cassandra (the default) or scylladb |
--server | required | Without --source: the node or nodes (host, host:port, a comma list) |
--port | required | Without --source: the port (9042) |
--keyspace | required | Without --source: the keyspace |
--user | required | Without --source: the user |
--secret | required | Without --source: the password, as the name of a secret (Setup > Secrets) or env:VARIABLE |
--connection | required | The database to import into: site (the default) or the identifier of a data table connection |
--tables | required | Only these tables (a comma list) |
--prefix | required | Put this in front of every table name (lower case letters, digits, ), e.g. ev |
--mode | required | create (the default: new tables only), append (add rows), replace (delete the rows first) |
--format | required | text (the default) or json |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expcassandraimport.php, kernel/private/classes/commands/expcassandraimport.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.