{"id":22709663,"url":"https://github.com/kena0ki/dddl","last_synced_at":"2026-04-30T01:39:45.491Z","repository":{"id":130644785,"uuid":"351788676","full_name":"kena0ki/dddl","owner":"kena0ki","description":"generates test Data from DDL.","archived":false,"fork":false,"pushed_at":"2022-12-23T12:30:48.000Z","size":809,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-04T22:14:50.678Z","etag":null,"topics":["data","database","db","ddl","generator","sql","table","test"],"latest_commit_sha":null,"homepage":"https://dddl-demo.netlify.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kena0ki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-26T13:19:30.000Z","updated_at":"2022-12-22T17:10:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"5680d5fe-f646-488c-ae5d-dfe954bf27af","html_url":"https://github.com/kena0ki/dddl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kena0ki%2Fdddl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kena0ki%2Fdddl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kena0ki%2Fdddl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kena0ki%2Fdddl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kena0ki","download_url":"https://codeload.github.com/kena0ki/dddl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246244527,"owners_count":20746458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","database","db","ddl","generator","sql","table","test"],"created_at":"2024-12-10T11:10:57.559Z","updated_at":"2026-04-30T01:39:45.448Z","avatar_url":"https://github.com/kena0ki.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dddl\n[![codecov](https://codecov.io/gh/kena0ki/dddl/branch/main/graph/badge.svg)](https://codecov.io/gh/kena0ki/dddl)\n\ndddl generates test Data from DDL (i.e. create table statements). \u003cbr\u003e\nHow data is generated depends on column types and options but the general idea is simple. \u003cbr\u003e\nGenerator adds 1 to previous data row by row so each column would have sequentially incremented number. \u003cbr\u003e\nGiven that we have the following statement, \u003cbr\u003e\n``` sql\n create table a (\n   c1 char(5),\n   c2 integer,\n   c3 float,\n   c4 binary(8)\n );\n```\nthen we would get the following.\n```\n   c1      c2  c3    c4\nL1 \"a0001\",\"1\",\"0.1\",\"b0000001\"\nL2 \"a0002\",\"2\",\"0.2\",\"b0000002\"\nL3 \"a0003\",\"3\",\"0.3\",\"b0000003\"\nL4 \"a0004\",\"4\",\"0.4\",\"b0000004\"\n```\n\u003e This library is not yet stable. Any features or APIs are subject to change even if it's a minor version update.\n\n## Getting started\n### Installation\n``` sh\nnpm install dddl\n```\n### Simple usage\n``` typescript\nimport { parseAndGenerate } from 'dddl';\nconst sql = `\ncreate table A (\n    col1 char(3)\n);\n`;\nasync function main() {\n  try {\n      const [rows, errors] = await parseAndGenerate(sql);\n      // rows -\u003e generated data\n      console.log(rows);\n      // errors -\u003e data validation errors\n      console.log(errors);\n  } catch(error) {\n      // error -\u003e parse error or data generation error\n      console.log(error);\n  }\n}\nmain();\n```\n\n## Working demo\n[Here](https://dddl-demo.netlify.app)\n\n## Options\nSee [API reference](https://dddl-api.netlify.app/interfaces/generator.generatoroption.html)\n\n## Supported types\nSee [API reference](https://dddl-api.netlify.app/modules/datatypes.html)\n\n## Data validation\nCurrently followings are supported.\n - PRIMARY KEY constraint\n - UNIQUE KEY constraint\n - NOT NULL constraint\n\n## SQL parser\nSQL syntax quite depends on DBMS products, so the create statement you have may or may not be valid for this library. \u003cbr\u003e\nHowever this library basically comforms with [the ANSI standards](https://en.wikipedia.org/wiki/ISO/IEC_9075) since the parser part of this library has been translated and ported from the Rust project named [sqlparser-rs](https://github.com/ballista-compute/sqlparser-rs), which aims to comform with the standards, so hopefully the core part of your create statement (i.e. column definition) is valid for this library.\n\n## Lisence\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkena0ki%2Fdddl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkena0ki%2Fdddl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkena0ki%2Fdddl/lists"}