Skip to main content

Initialize

Running with Docker

  1. Create a new directory and enter into the folder

    mkdir ~/wren-engine
    cd ~/wren-engine
  2. Make a file named docker-compose.yml then put below content into the file.

    version: '3.8'

    services:
    engine:
    image: ghcr.io/canner/wren-engine:latest
    platform: linux/amd64 # follow up your platform. (linux/amd64 or linux/arm64)(M1, M2, M3 is arm64)
    ports:
    - 8080:8080
    - 7432:7432
    volumes:
    - ./etc:/usr/src/app/etc
    environment:
    - SQLGLOT_PORT=8000
  3. Create a folder etc and enter the folder.

    mkdir etc
    cd etc
  4. Create config.properties put into etc

    node.environment=production
    wren.directory=/usr/src/app/etc/mdl
    pg-wire-protocol.auth.file=/usr/src/app/etc/accounts
    wren.datasource.type=duckdb

    We support many data source type, you can check out the Overview to get the idea.

  5. Create a file accounts put it into etc too

    howard pxd123
  6. Create a folder mdl and a file mdl.json and store the file in the folder, the path looks as etc/mdl/mdl.json

    {
    "catalog": "wren",
    "schema": "tpch",
    "models": [
    {
    "name": "Orders",
    "tableReference": {
    "catalog": "memory",
    "schema": "tpch",
    "table": "orders"
    },
    "columns": [
    {
    "name": "orderkey",
    "expression": "o_orderkey",
    "type": "integer"
    },
    {
    "name": "custkey",
    "expression": "o_custkey",
    "type": "integer"
    }
    ],
    "primaryKey": "orderkey"
    }
    ]
    }

    More about Modeling Definition Language

Running with JAR

  • Requirements:
    • Java 21+
  1. Download the jar from the GitHub release(TBD: URL) and rename it to wren-server-executable.jar

  2. Create a new directory and move the Wren Engine JAR into it

    mkdir ~/wren-engine

    then

    mv ~/Downloads/wren-server-executable.jar ~/wren-engine
  3. Go to the folder Wren Engine directory and prepare config files

    cd ~/wren-engine
  4. Create a folder etc and enter it.

    mkdir etc
    cd etc
  5. Create config.properties

    node.environment=production
    wren.directory=/usr/src/app/etc/mdl
    pg-wire-protocol.auth.file=/usr/src/app/etc/accounts
    wren.datasource.type=duckdb

    We support many data source type, you can check out the Overview to get the idea.

  6. Create a file accounts

    howard pxd123
  7. Create a folder mdl and a file mdl.json, and put it in the mdl folder, path as etc/mdl/mdl.json

    {
    "catalog": "wren",
    "schema": "tpch",
    "models": [
    {
    "name": "Orders",
    "tableReference": {
    "catalog": "memory",
    "schema": "tpch",
    "table": "orders"
    },
    "columns": [
    {
    "name": "orderkey",
    "expression": "o_orderkey",
    "type": "integer"
    },
    {
    "name": "custkey",
    "expression": "o_custkey",
    "type": "integer"
    }
    ],
    "primaryKey": "orderkey"
    }
    ]
    }

    More about Modeling Definition Language