https://github.com/elitan/tsql
A type-safe SQL query builder and database toolkit for TypeScript.
https://github.com/elitan/tsql
bun database mssql mysql nodejs postgres sql sqlite typescript
Last synced: 7 months ago
JSON representation
A type-safe SQL query builder and database toolkit for TypeScript.
- Host: GitHub
- URL: https://github.com/elitan/tsql
- Owner: elitan
- Created: 2025-01-18T13:55:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-21T00:32:04.000Z (7 months ago)
- Last Synced: 2025-09-21T02:35:39.730Z (7 months ago)
- Topics: bun, database, mssql, mysql, nodejs, postgres, sql, sqlite, typescript
- Language: MDX
- Homepage: https://tsql.space
- Size: 234 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tSQL
tSQL is a type-safe SQL query builder and database toolkit for TypeScript.
```ts
const users = await db
.selectFrom("users")
.select(["id", "name", "email"])
.execute();
// users is now typed as { id: number; name: string; email: string }[]
```
## Features
- **Fluent API**: Fully type-safe SQL query builder with a fluent API.
- **Automatic Type Generation**: Automatic type generation from your database schema.
- **Multi-Dialect Support**: Compatible with popular SQL databases including PostgreSQL, MySQL, SQLite, and MSSQL.
## Documentation
[tsql.space](https://tsql.space) is the official documentation for tSQL.
## Contributions
tSQL builds upon the excellent work of the following open-source projects:
- [Kysely](https://github.com/kysely-org/kysely): A type-safe SQL query builder for TypeScript.
- [kysely-codegen](https://github.com/RobinBlomberg/kysely-codegen): A code generator for Kysely.
We are grateful to the maintainers and contributors of these projects.
## License
MIT