ilbertt/bun-sqlgen has 113 GitHub stars and 2 forks. Star changes are not measured yet. Last checked 2026-11-14 08:31 UTC. Last push 2026-10-14.
計測したスター増加
- 24時間
- 履歴を収集中
- 7日間
- 履歴を収集中
- 15日間
- 履歴を収集中
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
概要
Types generator for your Bun.sql queries
データREADME.md
オリジナルbun-sqlgen
Types generator for your
Bun.sqlqueries
You don't need an ORM to have type-safe SQL statements in your Bun application.
@ilbertt/bun-sqlgen is a codegen tool that validates your queries against your schema and generates their result types.
No running database is needed at codegen time, because your migrations run against an in-memory Wasm Postgres (PGlite).
Install
bun add @ilbertt/bun-sqlgen
Quick start
Your migrations are the source of truth for the schema — put them in any folder:
-- db/migrations/0001_init.sql CREATE TABLE users ( id bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY, email text NOT NULL, display_name text );Wrap your client with
withTypesand tag each query with its name:import { withTypes } from '@ilbertt/bun-sqlgen'; import { SQL } from 'bun'; const sql = withTypes(new SQL('postgres://localhost/example')); export async function getUser(id: number) { const [user] = await sql.GetUser` SELECT id, email, display_name FROM users WHERE id = ${id} `; return user; // { id: string; email: string; display_name: string | null } }Generate the types:
bun bun-sqlgen generate 'src/**/*.ts' --migrations db/migrationsThis writes
src/queries.gen.ts— commit it. With it in place,user.whateveris a compile error anduser.display_name.lengthis flagged as possibly-null, all by plaintsc.The same file also describes your schema — every table and view with its columns, index names and constraint names:
import type { DatabaseTables } from '@ilbertt/bun-sqlgen'; type UserRow = DatabaseTables['users']['columns']; // { id: string; email: string; … } type UserIndex = DatabaseTables['users']['indexes']; // 'users_pkey' | 'users_email_idx'
Examples
Runnable projects live in the examples/ folder.
Contributing
Development setup and conventions are in CONTRIBUTING.md.
関連プロジェクトを探す
Asabeneh/30-Days-Of-Python
30 Days of Python プログラミングチャレンジは、Python プログラミング言語を 30 日で学ぶためのステップバイステップのガイドです。このチャレンジは 100 日以上かかることもあります。自分のペースで進めてください。こちらの動画も役立つかもしれません: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,728 スターgrafana/grafana
オープンで組み合わせ可能なオブザーバビリティおよびデータ可視化プラットフォームです。Prometheus、Loki、Elasticsearch、InfluxDB、Postgres など、複数のソースからメトリクス、ログ、トレースを可視化できます。
77,898 スターredis/redis
リアルタイムのデータ駆動型アプリケーションを構築する開発者にとって、Redis は最も選ばれ、最速で、機能が最も豊富なキャッシュ、データ構造サーバー、ドキュメントおよびベクトルクエリエンジンです。
77,491 スターapache/superset
Apache Superset は、データ可視化とデータ探索のためのプラットフォームです。
75,522 スター