{"_id":"@alkdev/drizzlebox","name":"@alkdev/drizzlebox","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alkdev/drizzlebox","version":"0.1.0","description":"Generate Typebox schemas from Drizzle ORM schemas — fork of drizzle-typebox with @alkdev/typebox support","type":"module","scripts":{"build":"tsx scripts/build.ts","b":"pnpm build","test:types":"cd tests && tsc","pack":"(cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz","test":"vitest run"},"exports":{".":{"import":{"types":"./index.d.mts","default":"./index.mjs"},"require":{"types":"./index.d.cjs","default":"./index.cjs"},"types":"./index.d.ts","default":"./index.mjs"}},"main":"./index.cjs","module":"./index.mjs","types":"./index.d.ts","repository":{"type":"git","url":"git+https://git.alk.dev/alkdev/drizzlebox.git"},"keywords":["typebox","drizzlebox","validate","validation","schema","drizzle","orm","pg","mysql","postgresql","postgres","sqlite","database","sql","typescript","ts"],"author":{"name":"Based on drizzle-typebox by Drizzle Team; fork maintained by alkdev"},"license":"Apache-2.0","peerDependencies":{"@alkdev/typebox":">=0.34.49","drizzle-orm":">=0.36.0"},"devDependencies":{"@alkdev/typebox":"^0.34.49","@babel/parser":"^7.24.0","@rollup/plugin-typescript":"^11.1.0","@types/node":"^18.15.10","cpy":"^10.1.0","drizzle-orm":"^0.38.4","recast":"^0.23.9","resolve-tspaths":"^0.8.23","rimraf":"^5.0.0","rollup":"^3.20.7","tsx":"^4.0.0","typescript":"^5.4.0","vite-tsconfig-paths":"^4.3.2","vitest":"^1.6.0","zx":"^7.2.2"},"_id":"@alkdev/drizzlebox@0.1.0","_integrity":"sha512-m9GLmbV2R4kOOXMz6la8aWJAfR36M5rN3r/mi4mtjIY3Xf4psJCr6YNb5N8Vg3LTU0ekg5WidvT82QvBEUCqTg==","_resolved":"/workspace/@alkdev/drizzlebox/dist/alkdev-drizzlebox-0.1.0.tgz","_from":"file:/workspace/@alkdev/drizzlebox/dist/alkdev-drizzlebox-0.1.0.tgz","_nodeVersion":"25.8.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-m9GLmbV2R4kOOXMz6la8aWJAfR36M5rN3r/mi4mtjIY3Xf4psJCr6YNb5N8Vg3LTU0ekg5WidvT82QvBEUCqTg==","shasum":"e27721e9688d56ea07c15dd5e97ff35a28b13e8e","tarball":"https://registry.npmjs.org/@alkdev/drizzlebox/-/drizzlebox-0.1.0.tgz","fileCount":38,"unpackedSize":104723,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDApPsPniwQAbBu89tJgJe2sJysQIWtJzrTMsctW9m6xAiAMOshdmt7PZ7XANIOkue9y4p+c9oJ4v/hVqS43y0x13Q=="}]},"_npmUser":{"name":"alkdev","email":"admin@alk.dev"},"directories":{},"maintainers":[{"name":"alkdev","email":"admin@alk.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/drizzlebox_0.1.0_1777112180478_0.5766637458147188"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-25T10:16:20.352Z","0.1.0":"2026-04-25T10:16:20.648Z","modified":"2026-04-25T10:16:20.937Z"},"maintainers":[{"name":"alkdev","email":"admin@alk.dev"}],"description":"Generate Typebox schemas from Drizzle ORM schemas — fork of drizzle-typebox with @alkdev/typebox support","keywords":["typebox","drizzlebox","validate","validation","schema","drizzle","orm","pg","mysql","postgresql","postgres","sqlite","database","sql","typescript","ts"],"repository":{"type":"git","url":"git+https://git.alk.dev/alkdev/drizzlebox.git"},"author":{"name":"Based on drizzle-typebox by Drizzle Team; fork maintained by alkdev"},"license":"Apache-2.0","readme":"# @alkdev/drizzlebox\n\nGenerate [TypeBox](https://github.com/alkdev/typebox) schemas from [Drizzle ORM](https://orm.drizzle.team) schemas.\n\nThis is a fork of [drizzle-typebox](https://github.com/drizzle-team/drizzle-orm/tree/main/drizzle-typebox) by the Drizzle Team, adapted for use with `@alkdev/typebox` (a maintained fork of `@sinclair/typebox`).\n\n## Install\n\n```bash\nnpm install @alkdev/drizzlebox\nnpm install @alkdev/typebox\nnpm install drizzle-orm\n```\n\n## Features\n\n- Create select schemas for tables, views, and enums\n- Create insert and update schemas for tables\n- Supports all dialects: PostgreSQL, MySQL, and SQLite\n- Custom TypeBox instance support via `createSchemaFactory`\n\n## Usage\n\n```ts\nimport { pgEnum, pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core';\nimport { createInsertSchema, createSelectSchema, createUpdateSchema } from '@alkdev/drizzlebox';\nimport { Type } from '@alkdev/typebox';\nimport { Value } from '@alkdev/typebox/value';\n\nconst users = pgTable('users', {\n\tid: serial('id').primaryKey(),\n\tname: text('name').notNull(),\n\temail: text('email').notNull(),\n\trole: text('role', { enum: ['admin', 'user'] }).notNull(),\n\tcreatedAt: timestamp('created_at').notNull().defaultNow(),\n});\n\n// Schema for inserting a user\nconst insertUserSchema = createInsertSchema(users);\n\n// Schema for updating a user\nconst updateUserSchema = createUpdateSchema(users);\n\n// Schema for selecting a user\nconst selectUserSchema = createSelectSchema(users);\n\n// Overriding fields\nconst insertUserSchema = createInsertSchema(users, {\n\trole: Type.String(),\n});\n\n// Refining fields\nconst insertUserSchema = createInsertSchema(users, {\n\tid: (schema) => Type.Number({ ...schema, minimum: 0 }),\n\trole: Type.String(),\n});\n\n// Validation\nconst isUserValid: boolean = Value.Check(insertUserSchema, {\n\tname: 'John Doe',\n\temail: 'johndoe@test.com',\n\trole: 'admin',\n});\n```\n\n## Differences from drizzle-typebox\n\n- Uses `@alkdev/typebox` instead of `@sinclair/typebox`\n- Standalone package (no monorepo dependency)\n- Published as `@alkdev/drizzlebox` on npm\n\n## Attribution\n\nBased on [drizzle-typebox](https://github.com/drizzle-team/drizzle-orm/tree/main/drizzle-typebox) by the Drizzle Team, licensed under Apache-2.0.","readmeFilename":"README.md","_rev":"1-486b7b470da60d0144ba11e28e9cf5e6"}