{"repo":"galvez/kysely-tables","free":true,"listed":false,"github":"https://github.com/galvez/kysely-tables","clone":"git clone https://github.com/galvez/kysely-tables.git","description":"Use the same Kysely types for your schema, migrations and queries.","language":"TypeScript","stars":59,"topics":["database","database-management","kysely","migration-tool","migrations"],"license":null,"category":"databases-storage","readme_excerpt":"kysely-tables Use the same Kysely types for your SQL table schema , migrations and queries . - No need for an intermediary schema defining API or schema language. - No need to connect to the database to retrieve the schema structure. - No need to bloat your setup mixing multiple database libraries. Your Kysely types become the single source of truth for your CREATE TABLE statements. And also for creating and running migrations , very much like Prisma and Drizzle. [!IMPORTANT] This is a proof-of-concept project. The idea is to use annotation types to enhance regular Kysely types while keeping them working as before. The annotations are then used by a processor to generate SQL schemas and migrations (when diffing). It's in a state where it's just about good enough to start being tested in real projects. Bug reports and feature requests are extremely welcome. Read the blog post. Tutorial 1. Check out this repository, pnpm install and cd to ./examples/sqlite . 2. Inspect db.ts to see how tables are defined. Note that these types are fully Kysely-compatible. The schema types serve as hints for schema generation, but Kysely receives the underlying types it expects. In order for a table to recognized as such, the interface name needs to end with Table . Note also how we can use Kysely's Generated type together with this library's schema types. Same is true for ColumnType . 3. Still in db.ts , you'll notice how the Kysely database instance is created through a wrapper, createDatabase","default_branch":null,"files":null,"tree":[],"storefront":"/r/galvez","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/galvez/kysely-tables/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}