/piqued

The Piqued Toolchain

Primary LanguageTypeScriptMIT LicenseMIT

Piqued

Piqued is a query compiler for postgres & a language server. The goal of piqued is to enable developers to write queries in a natural (postgres-y) way, while still giving them the full power of typechecking and some of the good functionality an ORM provides.

⚠️⚠️⚠️ This is a work in progress ⚠️⚠️⚠️

Piqued is not even remotely stable. I'm building the boat as I set sail so that I can more easily understand the way it should work. If you want to work on it, I'd love the help but please do not use this for anything real yet.

Features

  • 🛠️ Query Compiling
  • 🕵️‍♂️ Typechecking
  • 🧩 Custom Type Parsing
  • 🖥️ Language Server

Examples

-- @params user_id
PREPARE get_user (int) AS
    SELECT "user" FROM "user" WHERE id=$1;
import userQueries from "./userQueries";
import pg from "pg";

const pool = new pg.Pool()
const queries = userQueries(pool);

queries
    .getUser({ userId: 2 })
    .one()
    .then(({ user: { name, email } }) => console.log(name, email));

Author(s)

Just me for now! @zwade/@zwad3