{"id":18554231,"url":"https://github.com/oracle/quicksql","last_synced_at":"2025-04-06T13:09:30.624Z","repository":{"id":203825634,"uuid":"709918962","full_name":"oracle/quicksql","owner":"oracle","description":"A library for generating DDL SQL and entity-relationship-diagrams from Quick SQL code","archived":false,"fork":false,"pushed_at":"2024-11-20T00:05:14.000Z","size":5048,"stargazers_count":55,"open_issues_count":14,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-30T12:08:55.717Z","etag":null,"topics":["ddl","erd","quicksql","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"upl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-25T16:48:51.000Z","updated_at":"2024-12-21T20:36:09.000Z","dependencies_parsed_at":"2023-10-27T17:33:46.927Z","dependency_job_id":"6942a73f-67fc-4263-8143-c7aa8dd71335","html_url":"https://github.com/oracle/quicksql","commit_stats":null,"previous_names":["oracle-samples/quicksql","oracle/quicksql"],"tags_count":8,"template":false,"template_full_name":"oracle/template-repo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fquicksql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fquicksql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fquicksql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fquicksql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle","download_url":"https://codeload.github.com/oracle/quicksql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"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":["ddl","erd","quicksql","sql"],"created_at":"2024-11-06T21:20:25.098Z","updated_at":"2025-04-06T13:09:30.603Z","avatar_url":"https://github.com/oracle.png","language":"JavaScript","readme":"# Quick SQL \u003c!-- omit in toc --\u003e\n\n[![Node.js CI](https://github.com/oracle/quicksql/actions/workflows/node.js.yml/badge.svg)](https://github.com/oracle/quicksql/actions/workflows/node.js.yml)\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\n- [Overview](#overview)\n- [Install](#install)\n- [Translating Quick SQL into Oracle SQL Data Definition Language (DDL)](#translating-quick-sql-into-oracle-sql-data-definition-language-ddl)\n    - [DDL NodeJS ECMA Script Module (ESM) Example](#ddl-nodejs-ecma-script-module-esm-example)\n    - [DDL NodeJS Common JS (CJS) Example](#ddl-nodejs-common-js-cjs-example)\n    - [DDL Browser ECMA Script Module (ESM) Example](#ddl-browser-ecma-script-module-esm-example)\n    - [DDL Browser Universal Module Definition (UMD) Example](#ddl-browser-universal-module-definition-umd-example)\n- [Transforming Quick SQL into an Entity-Relationship Diagram (ERD)](#transforming-quick-sql-into-an-entity-relationship-diagram-erd)\n- [Contributing](#contributing)\n- [Security](#security)\n- [License](#license)\n\n## Overview\n\nQuick SQL is a markdown-like shorthand syntax that expands to standards-based\nOracle SQL. It is useful to rapidly design and prototype data models. Take a\nlook at the example below:\n\n![Quick SQL](./assets/quick-sql-dark.png)\n\nPreviously, Quick SQL was only available within Oracle Application Express. This\nproject reimplements the Quick SQL parser and translator into a JavaScript\nlibrary which can be used in both NodeJS and the browser.\n\nThis repository also includes a Quick SQL to Entity Relationship Diagram\nmodule that can be used as seen in the example below:\n\n![Quick ERD](./assets/quick-erd-dark.png)\n\n## Install\n\n```bash\nnpm install @oracle/quicksql\n```\n\n## Translating Quick SQL into Oracle SQL Data Definition Language (DDL)\n\nThe Quick SQL to DDL translator is the product's core component, It allows users\nto transform a Quick SQL string into an Oracle SQL string.\n\nThe Quick SQL Syntax and Grammar are documented [here](./doc/user/quick-sql-grammar.md)\n\nSee below for examples of how to use this library.\n\n### Command Line Usage\n\nNPXJS regitry already contains package with conflicting name. To disambiguate, please use command like this:\n\n```\nnpx @oracle/quicksql test/apex/department_employees.qsql \u003e output.sql\n```\n\n### DDL NodeJS ECMA Script Module (ESM) Example\n\n```js\nimport { quicksql } from \"@oracle/quicksql\";\nimport fs from \"fs\";\n\ntry {\n    const text = fs.readFileSync( './test/department_employees.quicksql' );\n    console.log( new quicksql( text.toString() ).getDDL() );\n} catch( e ) {\n    console.error( e );\n};\n```\n\n### DDL NodeJS Common JS (CJS) Example\n\n```js\nconst { quicksql } = require( \"@oracle/quicksql\" );\nconst fs = require( \"fs\" );\n\ntry {\n    const text = fs.readFileSync( './test/department_employees.quicksql' );\n    console.log( new quicksql( text.toString() ).getDDL() );\n} catch( e ) {\n    console.error( e );\n};\n```\n\n### DDL Browser ECMA Script Module (ESM) Example\n\n```html\n\u003cscript type=\"module\"\u003e\n    import { quicksql } from './dist/quick-sql.js';\n    document.body.innerText = new quicksql(\n`departments /insert 2\n    name /nn\n    location\n    country\n    employees /insert 4\n        name /nn vc50\n        email /lower\n        cost center num\n        date hired\n        job vc255\n\nview emp_v departments employees\n\n# settings = { \"prefix\": null, \"semantics\": \"CHAR\", \"DV\": false }\n\n`\n    ).getDDL();\n\u003c/script\u003e\n```\n\n### DDL Browser Universal Module Definition (UMD) Example\n\n```html\n\u003cscript src=\"./dist/quick-sql.umd.cjs\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    document.body.innerText = new quickSQL.quicksql(\n`departments /insert 2\n    name /nn\n    location\n    country\n    employees /insert 4\n        name /nn vc50\n        email /lower\n        cost center num\n        date hired\n        job vc255\n\nview emp_v departments employees\n\n# settings = { \"prefix\": null, \"semantics\": \"CHAR\", \"DV\": false }\n\n`\n    ).toDDL();\n\u003c/script\u003e\n```\n\n## Transforming Quick SQL into an Entity-Relationship Diagram (ERD)\n\nRequires a paid library. Review the usage [here](./doc/user/quick-erd.md)\n\n## Contributing\n\nThis project welcomes contributions from the community. Before submitting a pull\nrequest, please [review our contribution guide](./CONTRIBUTING.md)\n\n## Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security\nvulnerability disclosure process\n\n## License\n\nCopyright (c) 2023 Oracle and/or its affiliates.\n\nReleased under the Universal Permissive License v1.0 as shown at\n\u003chttps://oss.oracle.com/licenses/upl/\u003e.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fquicksql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle%2Fquicksql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fquicksql/lists"}