Formateurs & Code
JSON vers Schéma Drizzle ORM
Drizzle pgTable definition with $inferSelect / $inferInsert.
Note de la rédaction
Understanding · A schema that's also a value.
Ce chapitre approfondi n'est actuellement disponible qu'en anglais. L'outil de conversion ci-dessus fonctionne dans votre langue ; le long article explicatif n'a pas encore été traduit.
Questions fréquentes
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.
Les internautes recherchent aussi
Outils similaires
More in this room.
- JSON vers React Hook Form + ZodSchéma de formulaire typé et hook useForm à partir d'une forme JSON.
- JSON vers Next.js Server ActionServer Action avec parsing Zod et revalidatePath.
- JSON vers Modèle de Schéma PrismaGénérez un bloc de modèle Prisma à partir d'un exemple JSON.
- JSON vers Entité TypeORMClasse TypeORM @Entity avec décorateurs et un identifiant généré.
- JSON vers Mongoose Schema + ModèleSchéma Mongoose + modèle avec timestamps et types.
- JSON vers Routeur tRPCÉchafaudage de routeur tRPC avec entrée Zod — liste, parId, créer.