Skip to content

Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL.

License

Notifications You must be signed in to change notification settings

ts-safeql/safeql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8185862 · Apr 8, 2025
Apr 8, 2025
Jan 7, 2025
Sep 15, 2022
Mar 2, 2025
Dec 22, 2024
Apr 8, 2025
May 15, 2024
Mar 16, 2025
Apr 24, 2023
Jul 24, 2022
May 15, 2024
Jul 24, 2022
Sep 8, 2022
Sep 10, 2024
Dec 22, 2024
Dec 22, 2024
Sep 9, 2022
Jul 24, 2022
Jun 10, 2024
Mar 16, 2025

Repository files navigation

SafeQL - Automatic Type Inference & Validation for PostgreSQL Queries • Get started

npm version

demo.mp4

Features

  • ⚡️ Automatic Type Inference & Validation:

    SafeQL automatically infers the type of the query result based on the query itself.

  • 🖖 Compatible With Popular SQL Libraries:

    SafeQL works with any PostgreSQL client, including Prisma, Sequelize, pg, Postgres.js, and more.

  • 🛠️ Easy To Use

    SafeQL was built in mind to be easy to use and integrate with your existing codebase.

  • 📦 Built with Monorepos & Microservices in mind:

    SafeQL was built with monorepos and microservices in mind, and it's easy to use with multiple databases.

Install

I would first recommend follow the instructions in the documentation.

Prerequisites

  1. Set up ESLint following the typescript-eslint Getting Started docs, to enable TypeScript language support in ESLint
  2. Install the node-gyp prerequisites for your operating system
npm install --save-dev @ts-safeql/eslint-plugin libpg-query

Sponsors