{"id":26440,"library":"stricture","title":"Stricture MicroDDL Schema Compiler and Code Generator","description":"Stricture 4.0.2 is a multi-target data definition language (MicroDDL) compiler that transforms a Markdown-inspired, line-based schema definition into MySQL scripts, Meadow schema files, relationship diagrams (Graphviz), data dictionaries (Markdown, LaTeX, CSV), and test fixtures. Unlike general-purpose schema tools, Stricture is purpose-built for the Meadow application framework and provides first-class support for audit columns, authorization definitions, and PICT UI definitions. The project follows a service-oriented architecture on the Pict/Fable 3.x stack, with both a Commander-based CLI and a programmatic API. Releases are irregular but stable; v3 introduced a major CLI syntax change (migrating from yargs to Commander subcommands).","status":"active","version":"4.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/stevenvelozo/stricture","tags":["javascript","ddl","microddl","schema","code-generator","mysql","meadow"],"install":[{"cmd":"npm install stricture","lang":"bash","label":"npm"},{"cmd":"yarn add stricture","lang":"bash","label":"yarn"},{"cmd":"pnpm add stricture","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core service architecture (Pict/Fable 3.x)","package":"@pict/pict","optional":false},{"reason":"CLI command handling via Commander.js","package":"@pict/pict-service-commandlineutility","optional":true}],"imports":[{"note":"Package is ESM-only since v3. CommonJS not supported.","wrong":"const stricture = require('stricture');","symbol":"default","correct":"import stricture from 'stricture';"},{"note":"Named exports available for individual services.","wrong":"import { StrictureCompiler } from './node_modules/stricture/lib/compiler.js';","symbol":"StrictureCompiler","correct":"import { StrictureCompiler } from 'stricture';"},{"note":"Generators are exported as named classes. Use with new MySQLGenerator().","wrong":null,"symbol":"MySQLGenerator","correct":"import { MySQLGenerator } from 'stricture';"}],"quickstart":{"code":"import stricture from 'stricture';\nimport { MySQLGenerator } from 'stricture';\n\nconst sources = [\n  {\n    'Name': 'Users',\n    'Columns': [\n      { 'Name': 'UserId', 'Type': 'int', 'PrimaryKey': true, 'Identity': true },\n      { 'Name': 'Username', 'Type': 'varchar(255)', 'Nullable': false },\n      { 'Name': 'Email', 'Type': 'varchar(255)', 'Nullable': false },\n      { 'Name': 'CreateDate', 'Type': 'datetime', 'Default': 'now()' }\n    ]\n  },\n  {\n    'Name': 'Posts',\n    'Columns': [\n      { 'Name': 'PostId', 'Type': 'int', 'PrimaryKey': true, 'Identity': true },\n      { 'Name': 'UserId', 'Type': 'int', 'ForeignKey': 'Users.UserId' },\n      { 'Name': 'Title', 'Type': 'varchar(255)', 'Nullable': false },\n      { 'Name': 'Body', 'Type': 'text', 'Nullable': false }\n    ]\n  }\n];\n\nconst model = { 'Tables': sources };\n\nconst compiler = new stricture.StrictureCompiler();\nconst compiled = compiler.compile(model);\n\nconst mysqlGen = new MySQLGenerator();\nconst sql = mysqlGen.generate(compiled);\n\nconsole.log(sql);","lang":"typescript","description":"Programmatically compile a JSON model and generate MySQL DDL using Stricture's ESM API."},"warnings":[{"fix":"Use 'stricture full Model.mddl' instead of 'stricture -i Model.mddl -c Full'","message":"CLI syntax changed in v3: subcommands replaced yargs-style options","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use import statements or dynamic import(). Add 'type': 'module' to package.json if needed.","message":"Package is ESM-only since v3. require() will fail with ERR_REQUIRE_ESM","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Migrate to subcommand syntax described in v3 migration guide.","message":"Legacy 'yargs' CLI is removed. Old command-line flags no longer work.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Use the programmatic API with model objects if you already have JSON; otherwise ensure input is .mddl.","message":"Compiler expects source files as .mddl text, not JSON. Passing JSON directly via API bypasses MicroDDL parsing.","severity":"gotcha","affected_versions":"*"},{"fix":"Use exact names: CreateDate, UpdateDate, Deleted (case-sensitive).","message":"Audit column detection is case-sensitive. 'CreateDate' is recognized but 'created_at' is not.","severity":"gotcha","affected_versions":"*"},{"fix":"Review generated migration scripts before running on production databases.","message":"Generated MySQL scripts include IF NOT EXISTS by default. No IF EXISTS in DROP statements.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'3':90 '4.0.2':9 'api':103 'applic':62 'architectur':86 'audit':71 'author':73 'base':28,98 'built':58 'chang':115 'class':68 'cli':99,113 'code':6,127 'code-gener':126 'column':72 'command':97,120 'commander-bas':96 'compil':4,19 'csv':44 'data':15,40 'ddl':123 'definit':16,30,74,78 'diagram':38 'dictionari':41 'file':36 'first':67 'first-class':66 'fixtur':47 'follow':81 'framework':63 'general':50 'general-purpos':49 'generat':7,128 'graphviz':39 'inspir':25 'introduc':110 'irregular':106 'javascript':122 'languag':17 'latex':43 'line':27 'line-bas':26 'major':112 'markdown':24,42 'markdown-inspir':23 'meadow':34,61,130 'microddl':2,18,124 'migrat':116 'multi':13 'multi-target':12 'mysql':32,129 'orient':85 'pict':76 'pict/fable':89 'programmat':102 'project':80 'provid':65 'purpos':51,57 'purpose-built':56 'relationship':37 'releas':104 'schema':3,29,35,52,125 'script':33 'servic':84 'service-ori':83 'stabl':108 'stack':92 'strictur':1,8,54 'subcommand':121 'support':69 'syntax':114 'target':14 'test':46 'tool':53 'transform':21 'ui':77 'unlik':48 'v3':109 'x':91 'yarg':118","created_at":"2026-05-01T13:49:59.468812+00:00","updated_at":"2026-05-01T13:49:59.468812+00:00","problems":[{"fix":"Switch to import statements or use dynamic import() as a fallback.","cause":"Package is ESM-only since v3, but code uses CommonJS require().","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/stricture/index.js not supported."},{"fix":"Use 'stricture full <input.mddl>' syntax instead.","cause":"Using deprecated yargs-style CLI options that were removed in v3.","error":"stricture: error: unknown option `-i'"},{"fix":"Import named export directly: import { StrictureCompiler } from 'stricture'.","cause":"Importing the default export and trying to access .StrictureCompiler, which may not exist or is not a constructor in the version used.","error":"TypeError: stricture.StrictureCompiler is not a constructor"},{"fix":"Use Node >= 14 and set 'type': 'module' in package.json, or use dynamic import().","cause":"Node.js version < 12, or 'type': 'module' not set in package.json when using import statements.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"stricture","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/stevenvelozo/stricture","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/stricture","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","serialization","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}