























I want you to give a look to a tool I have been working on for a while, Schemic. It's a tool that lets you author your database schema in Typescript, you forget about the DDL and just think on your database's native lingo.
I'd say the strongest points of the project is that it's a SUPERSET of the popular validation library Zod (https://zod.dev), which I'd say shines in representing typescript's type system in code. Schemic wraps it with database-specific flavour (opt-in, for precision) so you can do `s.string()` (zod drop-in, will work with any driver you choose) or `s.varchar()` (flavour added by the postgres driver).
I would like you to check it out and to the SurrealDB project (https://surrealdb.com/), right now that's the most complete driver, I'm working on getting the Postgres driver ready as well so more people can try it out.
Adoption is simple: `bunx @schemic/cli pull` will introspect your database and generate all schema files for you.
Extra bit: the resulting structure after a pull is concise enough that helps any AI agent understand the database easily. They are already good in both Typescript and Zod.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。