- Data Integrations
- CrateDB
Data Integrations
CrateDB
This is the implementation of the CrateDB handler for MindsDB.
CrateDB
CrateDB is a distributed SQL database management system that integrates a fully searchable document-oriented data store. It is open-source, written in Java, based on a shared-nothing architecture, and designed for high scalability. CrateDB includes components from Lucene, Elasticsearch and Netty.
Implementation
This handler was implemented using crate
, a Python library that allows you to use Python code to run SQL commands on CrateDB.
The required arguments to establish a connection are,
-
user
: username associated with database -
password
: password to authenticate your access -
host
: host to server IP address or hostname -
port
: port through which connection is to be made -
schema_name
: schema name to get tables fromNote: Default value of schema_name is ‘doc’
Usage
In order to make use of this handler and connect to CrateDB in MindsDB, the following syntax can be used,
CREATE DATABASE crate_datasource
WITH
engine='crate',
parameters={
"user":"crate",
"password":"",
"host":"127.0.0.1",
"port":4200,
"schema_name":"doc"
};
Now, you can use this established connection to query your database as follows,
SELECT * FROM crate_datasource.demo;