Skip to main content

Schema

Data Source

Supported data source

  • Bigquery
  • Clickhouse
  • MS SQL
  • MySQL
  • PostgreSQL
  • Snowflake

Manifest

  • catalog: a string to abstract original catalog
  • schema: a string to abstract original schema
  • models: an array containing Model to define the columns of model.
  • relationships: an array containing Relationship to define the relationship between the models.
{
"catalog": "wrenai",
"schema": "tpch_tiny",
"models": [
{
"name": "Orders",
"refSql": "select * from wrenai.tpch_tiny.orders",
{
"name": "orderkey",
"expression": "o_orderkey",
"type": "int4"
},
{
"name": "custkey",
"expression": "o_custkey",
"type": "int4"
},
"properties": {},
"primaryKey": "orderkey"
},
{
"name": "Customer",
"refSql": "...",
"columns": [ ... ]
}
],
"relationships": [
{
"name": "OrdersCustomer",
"models": [
"Orders",
"Customer"
],
"joinType": "MANY_TO_ONE",
"condition": "Orders.custkey = Customer.custkey"
}
]
}

Connection Info

The required connection info depends on the data source.

Bigquery:

  • project_id: string, required
  • dataset_id: string, required
  • credentials: Base64 encoded string of BigQuery credential file content
{
"connectionInfo": {
"project_id": "wrenai",
"dataset_id": "tpch_tiny",
"credentials": "ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3Rfa..."
}
}

ClickHouse

  • host: string, required
  • port: integer, required
  • user: string, required
  • password: string, required
  • database: string, required
{
"connectionInfo": {
"host": "localhost",
"port": 1433,
"database": "dbname",
"user": "username",
"password": "password"
}
}

or

  • connectionUrl: string, required
{
"connectionInfo": {
"connectionUrl": "clickhouse://username:password@localhost:1433/dbname"
}
}

PostgreSQL:

  • host: string, required
  • port: integer, required
  • user: string, required
  • password: string, required
  • database: string, required
{
"connectionInfo": {
"host": "localhost",
"port": 5432,
"database": "dbname",
"user": "username",
"password": "password"
}
}

or

  • connectionUrl: string, required
{
"connectionInfo": {
"connectionUrl": "postgres://username:password@localhost:5432/dbname"
}
}

MS SQL:

  • host: string, required
  • port: integer, required
  • database: string, required
  • user: string, required
  • password: string, required
  • driver: string, default is FreeTDS

⚠️ Warning: Ibis does not support mssql using connection url. Follow https://github.com/ibis-project/ibis/issues/9415

{
"connectionInfo": {
"host": "localhost",
"port": 1433,
"database": "dbname",
"user": "username",
"password": "password"
}
}

MySQL:

  • host: string, required
  • port: integer, required
  • user: string, required
  • password: string, required
  • database: string, required
{
"connectionInfo": {
"host": "localhost",
"port": 3306,
"database": "dbname",
"user": "username",
"password": "password"
}
}

or

  • connectionUrl: string, required
{
"connectionInfo": {
"connectionUrl": "mysql://username:password@localhost:3306/dbname"
}
}

Snowflake:

  • user: string, required
  • password: string, required
  • account: string, required
  • database: string, required
  • schema: string
{
"connectionInfo": {
"user": "user",
"password": "password",
"account": "snowflake_account",
"database": "SNOWFLAKE_SAMPLE_DATA"
}
}