https://github.com/ts-safeql/safeql
Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL.
https://github.com/ts-safeql/safeql
eslint eslint-plugin javascript lint postgres sql typescript
Last synced: 27 days ago
JSON representation
Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL.
- Host: GitHub
- URL: https://github.com/ts-safeql/safeql
- Owner: ts-safeql
- License: mit
- Created: 2022-09-08T06:27:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T17:35:32.000Z (7 months ago)
- Last Synced: 2024-10-29T14:53:01.705Z (6 months ago)
- Topics: eslint, eslint-plugin, javascript, lint, postgres, sql, typescript
- Language: TypeScript
- Homepage: https://safeql.dev
- Size: 2.27 MB
- Stars: 1,346
- Watchers: 9
- Forks: 22
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-typesafe - ts-safeql/safeql - Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL. (**1. Libraries** / Database)
README
![]()
SafeQL - Automatic Type Inference & Validation for PostgreSQL Queries • Get startedhttps://user-images.githubusercontent.com/10504365/192807716-6a4fcbc1-9dc8-4d3b-a63b-2c95c0061689.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](https://www.safeql.dev/guide/getting-started.html).
### Prerequisites
1. Set up ESLint following [the `typescript-eslint` Getting Started docs](https://typescript-eslint.io/getting-started), to enable TypeScript language support in ESLint
2. Install [the `node-gyp` prerequisites for your operating system](https://github.com/nodejs/node-gyp#on-unix)```bash
npm install --save-dev @ts-safeql/eslint-plugin libpg-query
```## Sponsors