CrateDB
CrateDB is a distributed and scalable SQL database for storing and analyzing massive amounts of data in near real-time, even with complex queries. It is PostgreSQL-compatible, and based on Lucene.
ingestr supports CrateDB as both a source and destination database.
Source
For connecting to CrateDB as a database source, ingestr uses the PostgreSQL wire protocol on port 5432 by default.
URI format
The URI format for CrateDB as a source is as follows:
cratedb://<username>:<password>@<host>:<port>?sslmode=<sslmode>INFO
When connecting to CrateDB on localhost, use:
cratedb://crate@localhost:5432?sslmode=disableWhen connecting to CrateDB Cloud, the URI looks like this:
cratedb://admin:<PASSWORD>@<CLUSTERNAME>.eks1.eu-west-1.aws.cratedb.net:5432?sslmode=requireURI parameters
username(required): The username is required to authenticate with the CrateDB server.password(required): The password is required to authenticate the provided username.host(required): The hostname or IP address of the CrateDB server where the database is hosted.port(required): The TCP port number used by the CrateDB server. Mostly5432.sslmode(optional): Set to one ofdisable,allow,prefer,require,verify-ca, orverify-full, see PostgreSQL SSL Mode Descriptions.
Example
This is an example command that will copy the sys.summits table from CrateDB to DuckDB, then display the content from DuckDB.
ingestr ingest \
--source-uri 'cratedb://crate@localhost:5432/?sslmode=disable' \
--source-table 'sys.summits' \
--dest-uri 'duckdb:///cratedb.duckdb' \
--dest-table 'dest.summits'duckdb cratedb.duckdb 'SELECT * FROM dest.summits LIMIT 5'
Destination
For connecting to CrateDB as a database destination, ingestr uses the PostgreSQL wire protocol on port 5432 by default.
URI format
The URI format for CrateDB as a destination is as follows:
cratedb://<username>:<password>@<host>:<port>?sslmode=<sslmode>INFO
When connecting to CrateDB on localhost, use:
cratedb://crate@localhost:5432?sslmode=disableWhen connecting to CrateDB Cloud, the URI looks like this:
cratedb://admin:<PASSWORD>@<CLUSTERNAME>.eks1.eu-west-1.aws.cratedb.net:5432?sslmode=requireURI parameters
username(required): The username is required to authenticate with the CrateDB server.password(required): The password is required to authenticate the provided username.host(required): The hostname or IP address of the CrateDB server where the database is hosted.port(required): The TCP port number used by the CrateDB server. Mostly5432.sslmode(optional): Set to one ofdisable,allow,prefer,require,verify-ca, orverify-full, see PostgreSQL SSL Mode Descriptions.
Example
This is an example command that will import a CSV file into CrateDB, then display the content from CrateDB.
wget -O input.csv https://github.com/bruin-data/ingestr/raw/refs/heads/main/ingestr/testdata/create_replace.csvingestr ingest \
--source-uri 'csv://input.csv' \
--source-table 'sample' \
--dest-uri 'cratedb://crate@localhost:5432/?sslmode=disable' \
--dest-table 'doc.sample'uvx crash -c 'SELECT * FROM doc.sample'
Appendix
To start a single-node instance of CrateDB for evaluation purposes, use Docker or Podman.
docker run --rm -it --name=cratedb \
--publish=4200:4200 --publish=5432:5432 \
--env=CRATE_HEAP_SIZE=2g crate/crate:nightly \
-Cdiscovery.type=single-nodeWe are tracking development progress and incompatibilities at Support for ingestr/CrateDB and "tool: dlt/ingestr". Please join the discussion or share relevant issue reports that help us improve interoperability. Thanks!