Installation

Get genaql installed in your project in under a minute.

Requirements

  • Node.js 18 or later
  • TypeScript 5.0+ (recommended for type safety)

Install genaql

Install genaql using your preferred package manager:

npm
npm install genaql
pnpm
pnpm add genaql
yarn
yarn add genaql
bun
bun add genaql

Database Drivers

To actually run queries against a database, install the driver for your database:

PostgreSQL

npm install pg

MySQL

npm install mysql2

SQLite

npm install better-sqlite3

Verify Installation

Create a test file to verify genaql is working:

test.ts
import { cook } from 'genaql';

const query = cook`main:users slay:* bet:1`;

console.log(query.toSQL());
// Should output: SELECT * FROM users LIMIT 1

You're Ready!

genaql is installed and ready to use. Head to the Quick Start guide to write your first real query.