Skip to content

ChaiSQL

ChaiSQL is an statically typed extension to the standard SQL query language.

  • Chai allows to perform type checking directly on SQL queryies.
  • It does so through comment-based type annotations.
ChaiSQL example
-- @chaisql:check

-- @chaisql:newtype Name = String
-- @chaisql:newtype Age = Number

-- @chaisql:newtype PersonView = DbView <bag> {name: Name, age: Age}

-- @chaisql:returns PersonView
SELECT
    -- @chaisql:returns Name
    p.name,
    -- @chaisql:returns Age
    p.age
FROM people AS p;

Why is it called ChaiSQL?

ChaiSQL's name originated from a word-play:

  1. SQL Type checking

    ["T" ~sounds like~ "tea"]

  2. SQL Tea

    ["chai" ~synonym~ "tea"]

  3. Chai SQL

    [tada!] ☕️

ChaiSQL mascot

chai-tea-icon
Credits: "Chai-Yen-Thai" created by Freepik - Flaticon


Installation

Coming soon!

Supported features

Coming soon!