SQL-first TypeScript code generator for PostgreSQL. Write plain SQL functions and procedures, and KyroSQL generates a fully-typed TypeScript package ready to import. Handles CREATE FUNCTION and CREATE PROCEDURE, resolves SELECT * using table schemas, and supports both npm publish and local linking. Version 0.0.5 is early alpha with no breaking changes yet. Differentiators: developer writes SQL files directly (not ORM-style code-first), generated code provides full TypeScript types and call signatures, and the generated package is a standard npm package that can be published or linked.
npm install kyrosqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows SQL-first workflow: write SQL function, define table schema, configure, build, then use generated typed function.
Place SQL files in the correct subdirectories. Use 'kyrosql init' to generate a config and example structure.
Use KyroSQL only with PostgreSQL projects. For other databases, consider other tools.
After 'kyrosql build', run 'kyrosql publish' to publish to npm or link locally.
Ensure each function returns a proper table type; procedures should include RETURNING clause or OUT parameters if output is needed.
Do not expect KyroSQL to generate CRUD for tables; it only generates functions and procedures.
Run 'kyrosql publish' after 'kyrosql build'. If using local linking, ensure 'npm link' was executed and application uses 'npm link @myapp/db'.
Install locally: npm install -D kyrosql, then use npx kyrosql <command>.
Ensure SQL files are in correct subdirectories (sql/functions/user/find-user-by-id.sql) and rerun 'kyrosql build'.
Use PostgreSQL-compatible syntax: e.g., CREATE OR REPLACE FUNCTION ... RETURNS TABLE (...) LANGUAGE plpgsql AS $$ ... $$;