Skip to content

格式化与代码

JSON 转 Drizzle ORM Schema

Drizzle pgTable definition with $inferSelect / $inferInsert.

Runs in your browser

编辑注

Understanding · A schema that's also a value.

本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。

常见问题

Quick answers.

How are column types determined?

The generator maps JSON primitives to PostgreSQL types. Strings are mapped to `text`, numbers to `integer` or `numeric`, and booleans to `boolean`.

Does it support nested objects?

JSON columns are defined using the `jsonb` type. For relational structures, you should define separate tables and establish foreign keys manually.

Is the output compatible with TypeScript?

Yes. The generated code includes `InferSelectModel` and `InferInsertModel` types to provide full type-safety for your database queries.

Are my data structures shared with a server?

No. The transformation happens entirely within your browser's memory, so your private schema designs are never transmitted or stored.

大家也在搜索

相关工具

More in this room.

查看所有 格式化与代码