{"id":47435,"library":"durcno","title":"Durcno","description":"Durcno is a TypeScript-native PostgreSQL query builder, migration manager, and type-safe database client designed for modern Node.js (v25.8.0+). Currently in alpha (v1.0.0-alpha.0), it requires Zod v4 as a peer dependency for runtime schema validation. It differentiates itself by leveraging Zod to infer TypeScript types directly from your database schema, enabling fully type-safe queries without code generation. Its migration system integrates with the query builder, allowing schema changes to be defined in the same DSL. Key differentiators include future-looking syntax, ESM-only, and deep TypeScript integration. Frequent alpha releases may introduce breaking changes.","status":"active","version":"1.0.0-alpha.0","language":"javascript","source_language":"en","source_url":"https://github.com/durcno/durcno","tags":["javascript","durcno","query","sql","ts","typescript","postgres","postgresql","pg"],"install":[{"cmd":"npm install durcno","lang":"bash","label":"npm"},{"cmd":"yarn add durcno","lang":"bash","label":"yarn"},{"cmd":"pnpm add durcno","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for type inference and runtime validation","package":"zod","optional":false}],"imports":[{"note":"Durcno is ESM-only; CommonJS require throws. The default export is the main client instance.","wrong":"const durcno = require('durcno')","symbol":"default","correct":"import durcno from 'durcno'"},{"note":"The tagged template literal function for building queries. Type-safe with Zod.","wrong":"import { sql } from 'durcno' (if incorrectly spelled as 'SQL')","symbol":"sql","correct":"import { sql } from 'durcno'"},{"note":"Migration manager; used programmatically or via CLI. Requires Node >=25.8.","wrong":null,"symbol":"migrate","correct":"import { migrate } from 'durcno'"}],"quickstart":{"code":"import durcno, { sql } from 'durcno';\nimport { z } from 'zod';\n\nconst db = durcno({\n  connectionString: process.env.DATABASE_URL ?? '',\n});\n\nconst UserSchema = z.object({\n  id: z.number(),\n  name: z.string(),\n  email: z.string().email(),\n});\n\nasync function main() {\n  const users = await db.query(sql`SELECT * FROM users WHERE id = ${1}`);\n  const parsed = UserSchema.array().parse(users);\n  console.log(parsed);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Shows how to create a database client, define a Zod schema, run a query with type inference, and parse the result."},"warnings":[{"fix":"Upgrade Node to v25.8.0 or later (e.g., use nvm or volta).","message":"Durcno requires Node.js >=25.8.0; older Node versions will throw an unsupported engine error.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure your project is configured for ESM (type: 'module' in package.json) or use dynamic import() from CJS.","message":"Durcno is ESM-only; CommonJS require() will fail with ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin to a specific alpha version and test upgrades carefully.","message":"Pre-1.0 alpha APIs may change without notice; do not use in production.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Install zod@^4.3.6 explicitly in your project.","message":"Zod v4 is a peer dependency; installing a different version may cause runtime type errors.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'allow':72 'alpha':26,97 'break':101 'builder':10,71 'chang':74,102 'client':18 'code':62 'current':24 'databas':17,53 'deep':93 'defin':77 'depend':35 'design':19 'differenti':41,83 'direct':50 'dsl':81 'durcno':1,2,104 'enabl':55 'esm':90 'esm-on':89 'frequent':96 'fulli':56 'futur':86 'future-look':85 'generat':63 'includ':84 'infer':47 'integr':67,95 'introduc':100 'javascript':103 'key':82 'leverag':44 'look':87 'manag':12 'may':99 'migrat':11,65 'modern':21 'nativ':7 'node.js':22 'peer':34 'pg':111 'postgr':109 'postgresql':8,110 'queri':9,60,70,105 'releas':98 'requir':29 'runtim':37 'safe':16,59 'schema':38,54,73 'sql':106 'syntax':88 'system':66 'ts':107 'type':15,49,58 'type-saf':14,57 'typescript':6,48,94,108 'typescript-n':5 'v1.0.0-alpha.0':27 'v25.8.0':23 'v4':31 'valid':39 'without':61 'zod':30,45","created_at":"2026-06-07T16:51:30.444842+00:00","updated_at":"2026-06-07T16:51:30.444842+00:00","problems":[{"fix":"Use import instead of require, or use dynamic import('durcno') from a CommonJS module.","cause":"Trying to require() a package that is ESM-only.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/durcno/index.mjs not supported."},{"fix":"Use import durcno from 'durcno' (default import).","cause":"Importing the default export incorrectly (e.g., using named import instead of default).","error":"TypeError: durcno is not a function"},{"fix":"Run npm install zod@^4.3.6.","cause":"Missing peer dependency zod.","error":"Error: Cannot find module 'zod'"}],"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://durcno.dev","github":"https://github.com/durcno/durcno","docs":null,"changelog":null,"pypi":null,"npm":"durcno","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-07","next_check":"2026-09-05","install_tag":null}}