CategoricalData / CQL

Categorical Query Language IDE
http://categoricaldata.net
299 stars 22 forks source link

sqlite #44

Closed v217 closed 4 years ago

v217 commented 4 years ago

Is there a way to work with sqlite databases. Wondered if there is a doc/tutorial to get started? Thanks

wisnesky commented 4 years ago

Sure, CQL does not ship with sqlite built-in, so first you'll need to find a sqlite JDBC driver. Then, I'd suggest following the "Importing and exporting SQL data over JDBC" example from https://www.categoricaldata.net/examples , reproduced in part below, but using sqlite in place of mysql.

This example is recommended for anyone dealing with SQL data and is built-in to the IDE as QuickSQL. It imports a cloud-based MySQL database about employees and departments into CQL, demonstrates basic CQL operations, and then exports the data into a CQL's in-memory SQL database, H2. Accessing any external SQL database management system in CQL requires adding the vendor's JDBC driver to the java classpath when running CQL; this example requires downloading MySQL connector-j version 5.1.47 (never version contain errors) and running CQL from the terminal in a directory containing both jar files (on Windows, replace : by ;):

java -cp "cql.jar:mysql-connector-java-5.1.47.jar" catdata.ide.IDE

Example URL: https://www.categoricaldata.net/help/QuickSQL.html

v217 commented 4 years ago

Thanks! I wasn't sure, if there was a shortcut. I will try my luck with https://bitbucket.org/xerial/sqlite-jdbc.