{"id":40835,"library":"drizzle-arktype","title":"drizzle-arktype","description":"A plugin for Drizzle ORM that auto-generates Arktype validation schemas from Drizzle table schemas, ensuring runtime validation aligns exactly with your database definitions. Version 0.1.3 is stable; release cadence is monthly. Key differentiator: eliminates manual duplication of validation logic when using Arktype with Drizzle, supporting PostgreSQL, MySQL, SQLite. Requires arktype >=2.0.0 and drizzle-orm >=0.36.0. Ships TypeScript types.","status":"active","version":"0.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/drizzle-team/drizzle-orm","tags":["javascript","arktype","validate","validation","schema","drizzle","orm","pg","mysql","typescript"],"install":[{"cmd":"npm install drizzle-arktype","lang":"bash","label":"npm"},{"cmd":"yarn add drizzle-arktype","lang":"bash","label":"yarn"},{"cmd":"pnpm add drizzle-arktype","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for defining and using Arktype schemas.","package":"arktype","optional":false},{"reason":"Peer dependency for Drizzle ORM schema definitions.","package":"drizzle-orm","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require is not supported.","wrong":"const drizzleArk = require('drizzle-arktype')","symbol":"drizzleArk","correct":"import { drizzleArk } from 'drizzle-arktype'"},{"note":"Use type import for TypeScript to avoid runtime inclusion.","symbol":"type ArkSchema","correct":"import type { ArkSchema } from 'drizzle-arktype'"},{"note":"Two separate inference functions; there is no unified inferSchema export.","wrong":"import { inferSchema } from 'drizzle-arktype'","symbol":"inferInsertSchema and inferSelectSchema","correct":"import { inferInsertSchema, inferSelectSchema } from 'drizzle-arktype'"}],"quickstart":{"code":"import { pgTable, integer, text } from 'drizzle-orm/pg-core';\nimport { drizzleArk } from 'drizzle-arktype';\n\nconst users = pgTable('users', {\n  id: integer().primaryKey(),\n  name: text().notNull(),\n});\n\nconst { schema, insertSchema, selectSchema } = drizzleArk(users);\n// schema: Ark type for full row\n// insertSchema: Ark type for insert (without auto-generated fields)\n// selectSchema: Ark type for select results\n\nimport { type } from 'arktype';\nconst parsed = schema({ id: 1, name: 'Alice' });\nconsole.log(parsed); // { id: 1, name: 'Alice' }\n\nconst invalid = schema({ id: '1', name: 'Bob' });\nconsole.log(invalid.problems); // validation errors","lang":"typescript","description":"Creates Arktype schemas from a Drizzle table definition and validates data."},"warnings":[{"fix":"Call drizzleArk() separately for each table.","message":"drizzleArk() only accepts a single table definition, not an array or object of tables.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use insertSchema for insert operations; do not provide generated fields.","message":"Auto-generated fields (like serial or default values) are not included in insertSchema; they must be omitted in inserts.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use import { type } from 'arktype' instead of legacy imports.","message":"The 'type' export from arktype is the preferred way to define schemas; older methods using 'Ark' may conflict.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Replace createDrizzleArk() with drizzleArk().","message":"Version 0.0.x had a different API using createDrizzleArk(); renamed to drizzleArk in 0.1.0.","severity":"breaking","affected_versions":"<0.1.0"}],"env_vars":null,"search_vec":"'0.1.3':30 '0.36.0':61 '2.0.0':56 'align':23 'arktyp':3,13,47,55,66 'auto':11 'auto-gener':10 'cadenc':34 'databas':27 'definit':28 'differenti':38 'drizzl':2,7,17,49,59,70 'drizzle-arktyp':1 'drizzle-orm':58 'duplic':41 'elimin':39 'ensur':20 'exact':24 'generat':12 'javascript':65 'key':37 'logic':44 'manual':40 'month':36 'mysql':52,73 'orm':8,60,71 'pg':72 'plugin':5 'postgresql':51 'releas':33 'requir':54 'runtim':21 'schema':15,19,69 'ship':62 'sqlite':53 'stabl':32 'support':50 'tabl':18 'type':64 'typescript':63,74 'use':46 'valid':14,22,43,67,68 'version':29","created_at":"2026-06-04T18:49:28.835206+00:00","updated_at":"2026-06-04T18:49:28.835206+00:00","problems":[{"fix":"Ensure drizzle-orm >=0.36.0 and arktype >=2.0.0 are installed: npm install drizzle-arktype arktype drizzle-orm","cause":"Missing install or incompatible versions of peer dependencies.","error":"Cannot find module 'drizzle-arktype' or its corresponding type declarations."},{"fix":"Change require() to import { drizzleArk } from 'drizzle-arktype'. If using CommonJS, use dynamic import: const { drizzleArk } = await import('drizzle-arktype').","cause":"Using CommonJS require instead of ESM import.","error":"TypeError: drizzleArk is not a function"},{"fix":"Check if result is a string: if (typeof parsed === 'string') { console.log('Error:', parsed); } else { console.log(parsed); }","cause":"Arktype returns a string on validation error, but code assumes an object with problems.","error":"Property 'problems' does not exist on type 'string | { ... }'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/drizzle-team/drizzle-orm#readme","github":"https://github.com/drizzle-team/drizzle-orm","docs":null,"changelog":null,"pypi":null,"npm":"drizzle-arktype","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}