{"id":43892,"library":"sql-ddl-sync","title":"sql-ddl-sync","description":"Node.js library for synchronizing SQL DDL schemas across MySQL, PostgreSQL, and SQLite. Version 0.4.0 is the latest stable release (no longer actively developed). It is part of the ORM2 ecosystem, used to automatically create, alter, or drop database tables to match defined model collections. Key differentiator: it handles schema migrations without manual SQL, but lacks documentation and is tied to the ORM2 driver interface.","status":"maintenance","version":"0.4.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/dresende/node-sql-ddl-sync","tags":["javascript","sql","ddl","sync","mysql","postgres","sqlite"],"install":[{"cmd":"npm install sql-ddl-sync","lang":"bash","label":"npm"},{"cmd":"yarn add sql-ddl-sync","lang":"bash","label":"yarn"},{"cmd":"pnpm add sql-ddl-sync","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require is supported. No default export; named export 'Sync' must be used.","wrong":"const Sync = require('sql-ddl-sync');","symbol":"Sync","correct":"import { Sync } from 'sql-ddl-sync';"},{"note":"TypeScript users should use type-only import if only using for types. However, the package does not ship TypeScript definitions.","wrong":"import { Sync } from 'sql-ddl-sync';","symbol":"Sync (type)","correct":"import type { Sync } from 'sql-ddl-sync';"},{"note":"require returns an object with Sync as a property; destructuring is required.","wrong":"const Sync = require('sql-ddl-sync');","symbol":"Sync (require)","correct":"const { Sync } = require('sql-ddl-sync');"}],"quickstart":{"code":"import { Sync } from 'sql-ddl-sync';\nimport orm from 'orm';\n\norm.connect('mysql://username:password@localhost/database', (err, db) => {\n  if (err) throw err;\n  const sync = new Sync({\n    dialect: 'mysql',\n    driver: db.driver,\n    debug: (text) => console.log('>', text)\n  });\n  sync.defineCollection('users', {\n    id: { type: 'serial', key: true },\n    name: { type: 'text', required: true },\n    email: { type: 'text' }\n  });\n  sync.sync((err) => {\n    if (err) console.error(err);\n    else console.log('Sync done');\n    process.exit(0);\n  });\n});","lang":"javascript","description":"Shows basic usage: connect ORM, define a collection, and synchronize to create table."},"warnings":[{"fix":"Ensure you have orm installed and connect before using Sync.","message":"Package requires ORM2 driver and is not standalone; must call sync() after defineCollection() or schema changes are not applied.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Create a .d.ts file for Sync or use // @ts-ignore.","message":"No TypeScript definitions are provided; using in TypeScript may require custom declarations.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.4.0':18 'across':12 'activ':26 'alter':39 'automat':37 'collect':48 'creat':38 'databas':42 'ddl':3,10,71 'defin':46 'develop':27 'differenti':50 'document':60 'driver':67 'drop':41 'ecosystem':34 'handl':52 'interfac':68 'javascript':69 'key':49 'lack':59 'latest':21 'librari':6 'longer':25 'manual':56 'match':45 'migrat':54 'model':47 'mysql':13,73 'node.js':5 'orm2':33,66 'part':30 'postgr':74 'postgresql':14 'releas':23 'schema':11,53 'sql':2,9,57,70 'sql-ddl-sync':1 'sqlite':16,75 'stabl':22 'sync':4,72 'synchron':8 'tabl':43 'tie':63 'use':35 'version':17 'without':55","created_at":"2026-06-05T17:01:58.750335+00:00","updated_at":"2026-06-05T17:01:58.750335+00:00","problems":[{"fix":"npm install orm and the appropriate database driver (e.g., mysql).","cause":"The package is not standalone; it depends on ORM2.","error":"Cannot find module 'orm'"},{"fix":"Use: const sync = new Sync({...});","cause":"Sync was not instantiated correctly (missing 'new' or wrong import).","error":"TypeError: sync.sync is not a function"}],"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/dresende/node-sql-ddl-sync#readme","github":"ssh://git@github.com/dresende/node-sql-ddl-sync","docs":null,"changelog":null,"pypi":null,"npm":"sql-ddl-sync","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-05","next_check":"2026-09-03","install_tag":null}}