");let A=`
+`+f(p)+T+D;if(typeof y=="number"&&(A+=" num",D.endsWith("_id")||D.endsWith("Id")))return A+=" /pk",A;if(typeof y=="object"){if(Array.isArray(y))for(let b in y){1<=b&&console.log("1 <= property !");const t=y[b];return this.introspect(D,t,p,!1)}else if(D!=""){let b=this.aggrSizes[D];A+=" /insert "+b}let k="";for(let b in y){const t=y[b];if(b!=null){const i=W(D),s=b.toLowerCase();if(D!=null&&i+"_id"==s&&00&&"0"<=k[0]&&k[0]<="9")T=!0;else for(let b in k){const t=k[b];if(A.indexOf(t)<0&&(t<"0"||"9"!0)}),0--"),y=y.replace(/\/* Non-default options:/g,""),S+=y,S+=`
+`;for(let b=0;b
+
+## Table of Contents
+
+- [API](#api)
+- [Error Types](#error-types)
+ - [Misaligned Attributes](#misaligned-attributes)
+ - [Invalid Object references](#invalid-object-references)
+ - [Invalid Table reference in a View](#invalid-table-reference-in-a-view)
+ - [Invalid foreign key](#invalid-foreign-key)
+ - [Duplicate ID](#duplicate-id)
+ - [Missconstructed column type](#missconstructed-column-type)
+
+## API
+
+Error diagnostics procedure is called like this
+
+```js
+let output = ddl.errorMsgs(`dept
+ col1
+ "is this table or misaligned column?"`);
+```
+
+It returns an array of the Error objects
+
+```js
+function SyntaxError( message, from, to, severity ) {
+ this.from = from;
+ this.to = to;
+ if( to == null )
+ this.to = new Offset(from.line, from.depth+1);
+ this.message = message;
+ this.severity = severity; // warning or error
+ if( severity == null )
+ this.severity = 'error';
+}
+```
+
+where error message offsets are structured as follows
+
+```js
+function Offset( line, depth ) {
+ this.line = line; // 0-based
+ this.depth = depth; // 0-based
+}
+```
+
+## Error Types
+
+### Misaligned Attributes
+
+Indentation refers to the spaces at the beginning of a code line. Where in most
+of the other other programming languages the indentation in code is for
+readability only, Quick SQL uses indentation to define Quick SQL tree/forest
+structure. Parent-child relationship in this tree is interpreted as ether table
+containing list of columns, or as 2 tables related with referential integrity
+key constraint.
+
+Inconsistent indentation is detected, with the error message designed to resolve
+any confusion.
+
+### Invalid Object references
+
+#### Invalid Table reference in a View
+
+Example:
+
+```quicksql
+dept
+ name
+
+view customer_view customer
+```
+
+Here the `customer` table (or view) is missing.
+
+#### Invalid foreign key
+
+Example:
+
+```quicksql
+department
+ name
+employee
+ dept /fk dept
+```
+
+Here the `dept` table (or view) is missing.
+
+#### Duplicate ID
+
+Since identity columns are generated by default, specifying them explicitly like
+this
+
+```quicksql
+dept
+ id
+```
+
+would be diagnosed an error.
+
+#### Missconstructed column type
+
+Quick SQL also recognizes syntactically invalid column types like this
+
+```quicksql
+dept
+ name vc-200
+ name vc0
+```
diff --git a/doc/error_diagnostics.md b/doc/error_diagnostics.md
deleted file mode 100644
index 1cec12a..0000000
--- a/doc/error_diagnostics.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# Error Diagnostics
-
-# API
-
-Error diagnostics procedure is called like this
-
-
- let output = ddl.errorMsgs(`dept
- col1
- "is this table or misaligned column?"`);
-
-
-It returns an array of the Error objects
-
-
- function SyntaxError( message, from, to, severity ) {
- this.from = from;
- this.to = to;
- if( to == null )
- this.to = new Offset(from.line, from.depth+1);
- this.message = message;
- this.severity = severity; // warning or error
- if( severity == null )
- this.severity = 'error';
- }
-
-
-where error message offsets are stuctured as follows
-
-
- function Offset( line, depth ) {
- this.line = line; // 0-based
- this.depth = depth; // 0-based
- }
-
-
-# Error Types
-
-## Misaligned Attributes
-
-Indentation refers to the spaces at the beginning of a code line. Where in most of the other other programming languages the indentation in code is for readability only, QSQL uses indentation to define QSQL tree/forest structure. Parent-child relationship in this tree is interpreted as ether table containing list of columns, or as 2 tables related with referential integrity key constraint.
-
-Inconsistent indentation is detected, with the error message designed to resolve any confusion.
-
-## Invalid Object references
-
-### Invalid Table reference in a View
-
-Exanple:
-
- dept
- name
-
- view customer_view customer
-
-
-Here the `customer` table (or view) is missing.
-
-### Invalid foreign key
-
-Exanple:
-
- department
- name
- empployee
- dept /fk dept
-
-Here the `dept` table (or view) is missing.
-
-### Duplicate ID
-
-Since identity columns are generated by default, specifying them explictly like this
-
- dept
- id
-
-would be diagnosed an error.
-
-### Misconstructed column type
-
-QSQL also recognizes syntactically invalid column types like this
-
- dept
- name vc-200
- name vc0
-
-
-
-
diff --git a/doc/quick-erd.md b/doc/quick-erd.md
new file mode 100644
index 0000000..b3e9d74
--- /dev/null
+++ b/doc/quick-erd.md
@@ -0,0 +1,198 @@
+# Quick ERD
+
+Used to transform Quick SQL into an Entity-Relationship Diagram (ERD)
+
+## Table of Contents
+
+- [Prerequisites](#prerequisites)
+- [ERD Browser ESM Example](#erd-browser-esm-example)
+- [ERD Browser UMD Example](#erd-browser-umd-example)
+- [ERD Theming](#erd-theming)
+
+## Prerequisites
+
+You need to add the following dependencies to your HTML:
+
+- JointJS+ v3.5.0 (Requires a paid License). This requires the following
+ dependencies (See the [JointJS+
+ Documentation](https://resources.jointjs.com/docs/rappid/v3.5/index.html)):
+
+ - jQuery
+ - lodash
+ - Backbone JS
+
+## ERD Browser ESM Example
+
+
+```html
+
+
+
+
+
+ Quick ERD
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+
+## ERD Browser UMD Example
+
+
+```html
+
+
+
+
+
+ Quick ERD
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+
+## ERD Theming
+
+By default, the diagram uses a neutral color scheme as per below:
+
+
+
+However, the diagram can be themed using CSS variables as shown in the example below:
+
+```css
+/* Light Theme */
+:root {
+ --qs-diagram-table-background-color: #FFF;
+ --qs-diagram-font-family: var(--a-base-font-family, sans-serif);
+ --qs-diagram-table-border-color: #f1efed;
+ --qs-diagram-table-name-text-color: rgb(22 21 19);
+ --qs-diagram-table-column-text-color: rgba(22, 21, 19, .9);
+ --qs-diagram-table-data-type-text-color: rgba(22, 21, 19, .5);
+ --qs-diagram-table-separator-color: #e7e3e1;
+}
+/* Dark Theme */
+@media (prefers-color-scheme: dark) {
+ :root {
+ --qs-diagram-table-background-color: #4a4541;
+ --qs-diagram-font-family: var(--a-base-font-family, sans-serif);
+ --qs-diagram-table-border-color: #55504c;
+ --qs-diagram-table-text-color: #fcfbfa;
+ --qs-diagram-table-name-text-color: white;
+ --qs-diagram-table-column-text-color: rgb(255 255 255 / 90%);
+ --qs-diagram-table-data-type-text-color: rgb(255 255 255 / 60%);
+ --qs-diagram-table-separator-color: #55504c;
+ }
+}
+```
+
+Which would produce the following:
+
+- Light Color Scheme
+
+ 
+
+- Dark Color Scheme
+
+ 
diff --git a/doc/quick-sql-grammar.md b/doc/quick-sql-grammar.md
new file mode 100644
index 0000000..ecc1603
--- /dev/null
+++ b/doc/quick-sql-grammar.md
@@ -0,0 +1,450 @@
+# Quick SQL Grammar
+
+## Table of Contents
+
+- [Datatypes](#datatypes)
+- [Table Directives](#table-directives)
+- [Column Directives](#column-directives)
+- [Views](#views)
+ - [View Syntax](#view-syntax)
+ - [View Example](#view-example)
+- [Settings](#settings)
+ - [apex](#apex)
+ - [api](#api)
+ - [auditcols](#auditcols)
+ - [compress](#compress)
+ - [createdByCol](#createdbycol)
+ - [createdCol](#createdcol)
+ - [date](#date)
+ - [db](#db)
+ - [drop](#drop)
+ - [language](#language)
+ - [longVC](#longvc)
+ - [ondelete](#ondelete)
+ - [overrideSettings](#overridesettings)
+ - [PK](#pk)
+ - [prefix](#prefix)
+ - [prefixPKwithTname](#prefixpkwithtname)
+ - [genPK](#genpk)
+ - [resetsettings](#resetsettings)
+ - [rowkey](#rowkey)
+ - [tenantID](#tenantid)
+ - [rowVersion](#rowversion)
+ - [schema](#schema)
+ - [semantics](#semantics)
+ - [updatedByCol](#updatedbycol)
+ - [updatedCol](#updatedcol)
+ - [verbose](#verbose)
+- [Grammar](#grammar)
+
+
+
+## Datatypes
+
+
+| Type | DB Type |
+| ------------------------------------------- | ----------------------------- |
+| num, number | NUMBER |
+| int, integer | INTEGER |
+| d, date | DATE |
+| ts, timestamp | TIMESTAMP |
+| tstz, tswtz, timestamp with local time zone | TIMESTAMP WITH LOCAL TIMEZONE |
+| char, vc, varchar, varchar2, string | VARCHAR2(4000) |
+| vcNNN,vc(NNN) | VARCHAR2(NNN) |
+| vc32k | VARCHAR2(32767) |
+| clob | CLOB |
+| blob | BLOB |
+| json | CLOB CHECK (<COLUMN_NAME> IS JSON) |
+| file | Adds a BLOB column and _FILENAME, \_CHARSET, \_MIMETYPE, \_LASTUPD columns that enhance the ability for file download via a browser |
+
+
+## Table Directives
+
+
+| Directive | Description |
+| --------------------------------------- | --------------------------------- |
+| /api | Generate PL/SQL package API to query, insert, update, and delete data within a table. Adds Oracle auditing, by default AUDIT ALL ON <TABLE NAME>. |
+| /audit | Adds Oracle auditing, by default AUDIT ALL ON <TABLE NAME>. |
+| /auditcols, /audit cols, /audit columns | Automatically adds an UPDATED, UPDATED_BY, INSERTED, and INSERTED_BY columns and the trigger logic to set column values. |
+| /colprefix | Prefix all columns of a given table with this value. Automatically adds an underscore if not provided. |
+| /compress, /compressed | Table will be created compressed. |
+| /insert NN | Generate NN SQL INSERT statement(s) with random data, for example: /INSERT 20. (Maximum = 1000) |
+| /rest | Generate REST enablement of the table using Oracle REST Data Services (ORDS) |
+| /select | Generate SQL SELECT statement after generating data for each table |
+| /unique | Generate table level unique constraint |
+
+
+## Column Directives
+
+
+| Directive | Description |
+| ------------------------------ | ------------------------------------------ |
+| /idx, /index, /indexed | Creates a non unique index |
+| /unique | Creates a unique constraint |
+| /check | Creates a check constraint with comma or white space delimited values e.g. /check Yes, No |
+| /constant | When generating data set this column to a constant value. For example /constant NYC. |
+| /default | Adds default value if the column is null |
+| /values | Comma separated list of values to use when generating data. For example /values 1, 2, 3, 4 or /values Yes, No. |
+| /upper | Forces column values to upper case |
+| /lower | Forces column values to lower case |
+| /nn, /not null | Adds a not null constraint on the column |
+| /between | Adds a between check constraint on the column, for example /between 1 and 100 |
+| /hidden, /invisible | Hidden columns are not displayed using select * from table. |
+| /references, /reference, /fk | Foreign key references e.g. /references table_name. Note you can reference tables that are not part of your model. |
+| /pk | Identifies column as the primary key of the table. It is recommended not manually specify primary keys and let this app create primary key columns automatically. |
+| --, [comments] | Enclose comments using square brackets or using dash dash syntax |
+
+
+## Views
+
+### View Syntax
+
+```quicksql
+view [view_name] [table name] [table name]...
+```
+
+Ensure the view name contains no spaces, ensure the table names contain no
+spaces. Delimit table names by a space or comma.
+
+### View Example
+
+```quicksql
+dept dname loc emp ename job view dept_emp emp dept
+```
+
+This syntax restricts views to conjunctive queries (i.e. containing equijoin
+predicates) only.
+
+## Settings
+
+You can enter inline settings to explicitly set SQL syntax generation options.
+Alternatively, you can click Settings at the top of the right pane to
+declaratively set the generation options.
+
+Entering settings directly into the Quick SQL Shorthand pane ensures the same
+SQL generation options are utilized even if you download the script and later
+paste it back. For example, enter the following to prefix all table names with
+TEST and generate for schema OBE:
+
+```quicksql
+# settings = { prefix: "test", schema: "OBE" }
+```
+
+Alternatively, enter each setting on a separate line for the same result:
+
+```quicksql
+# prefix: "test"
+```
+
+```quicksql
+# schema: "OBE"
+```
+
+Note: The settings must start on a new line and begin with # settings = to enter
+multiple settings, or # to enter a single setting per line. All values are case
+insensitive. Brackets, spaces, and commas can be added for clarity but are
+ignored. To have all settings generated use:
+
+```quicksql
+# verbose: true
+```
+
+The available settings are listed in the below sections.
+
+### apex
+
+**Possible values**: `true`, `false`
+**Default value**: `false`
+
+This setting controls the syntax generated to support audit columns.
+Specifically if audit columns are enabled triggers are generated to maintain the
+user creating a row and the user last updating a row. When enabled the following
+function is used:
+
+```sql
+coalesce(sys_context('APEX$SESSION','APP_USER'),user)
+```
+
+When not enabled the following function is used:
+
+```sql
+user
+```
+
+### api
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+Generate PL/SQL APIs on all tables for create, insert, update, delete and query.
+
+### auditcols
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+Adds an additional created, created_by, updated and updated_by columns to every
+table created.
+
+### compress
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+When enabled creates all tables compressed.
+
+### createdByCol
+
+**Default Value**: `created_by`
+
+When Audit Columns are enabled the default column used to track the user who
+created a row is CREATED_BY. Use this setting to override default audit column
+name.
+
+### createdCol
+
+**Default Value**: created
+
+When Audit Columns are enabled the default column used to track the user who
+created a row is CREATED. Use this setting to override default audit column
+name.
+
+### date
+
+**Possible Values**: `date`, `timestamp`, `timestamp with timezone`, `TSWTZ`,
+`timestamp with local time zone`, `TSWLTZ`
+**Default Value**: `date`
+
+By default all DATE columns created using the Oracle DATE datatype. Use this
+setting to override this default.
+
+### db
+
+**Possible Values**: `11g`, `12c`, `19c`, `21c`
+**Default Value**: `21c`
+
+Specifies the database version the syntax should be compatible with.
+
+### drop
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+Include SQL commands to drop each database object created.
+
+### language
+
+**Possible Values**: `EN`, `DE`, `KO`, `JA`
+**Default Value**: `EN`
+
+Generate data used for insert statements using this language.
+
+### longVC
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+Allow longer identifiers to be used for database object names. Longer
+identifiers allow the maximum length a VARCHAR2 column datatype will be 32767
+characters. When not set the maximum length of a VARCHAR2 column datatype will
+be 4000 characters.
+
+### ondelete
+
+**Possible Values**: `cascade`, `restrict`, `set null`
+**Default Value**: `cascade`
+
+This setting controls how foreign key ON DELETE settings.
+
+### overrideSettings
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+When enabled all application settings set via the user interface console are
+ignored and only settings set in the script will be used.
+
+### PK
+
+**Possible Values**: `guid`, `seq`, `identity`, `none`
+**Default Value**: `identity`
+
+Determines how the primary key will be set. Primary keys can be set using
+SYS_GUID, identity column or sequence.
+
+### prefix
+
+Database object prefix. An underscore will be appended if not provided.
+
+### prefixPKwithTname
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+Prefix primary key database table columns with name of table. For example the
+primary key of the EMPLOYEE table would be EMPLOYEE_ID. Without setting the name
+of implicitly created primary key columns will be ID.
+
+### genPK
+
+**Possible Values**: `true`, `false`
+**Default Value**: `true`
+
+Automatically generate an ID primary key column for each table.
+
+### resetsettings
+
+Resets all application settings to default values. When included all application
+settings currently active for your session will be ignored.
+
+### rowkey
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+For each table created add a ROW_KEY column that generates an alphanumeric
+identifier. Values of the ROW_KEY column will be set by generated database table
+trigger logic.
+
+### tenantID
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+For each table add a TENANT_ID column to support multi-tenant applications. The
+value of this column is simply added to the table, maintaining this value will
+need to be provided by the developer.
+
+### rowVersion
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+For each table generated add a ROW_VERSION column that increments by 1 for each
+update. When enabled database table trigger logic will be generated to increment
+row versions on update.
+
+### schema
+
+Prefix object names with a schema name. The default is no schema prefix for
+object names.
+
+### semantics
+
+**Possible Values**: `char`, `byte`
+
+You can choose between:
+
+- No column semantics:
+
+ ```sql
+ varchar2(4000)
+ ```
+
+- Byte semantics:
+
+ ```sql
+ varchar2(4000 byte)
+ ```
+
+- Char semantics
+
+ ```sql
+ varchar2(4000 char)
+ ```
+
+### updatedByCol
+
+**Default Value**: `updated_by`
+
+When enabling audit columns use this setting to override default audit column name.
+
+### updatedCol
+
+**Default Value**: `updated`
+
+When enabling audit columns use this setting to override default audit column name.
+
+### verbose
+
+**Possible Values**: `true`, `false`
+**Default Value**: `false`
+
+Show all settings, not just settings that are different from the default.
+
+## Grammar
+
+```abnf
+qddl::= stmt+
+
+stmt::= tree
+ | view
+ | '#' individual_setting
+ | 'settings' '=' '{' individual_setting ( ',' individual_setting )* '}'
+
+view::= 'view' view_name table_name+
+view_name::= identifier
+table_name::= identifier
+column_name::= identifier
+
+tree::= node+
+
+tableNode::= indentation tableName tableDirective*
+columnNode::= indentation columnName columnDirective* datatype*
+
+indentation::= INDENT | DEDENT | SAMELEVEL
+
+tableDirective::= '/'
+ ('api'
+ |'audit'|'auditcols'|'audit cols'|'audit columns'
+ |'colprefix'
+ |'compress'|'compressed'
+ |'insert' integer
+ |'rest'
+ |'select'
+ |'unique' )
+
+columnDirective::= '/'
+ ('idx'|'index'|'indexed'
+ |'unique'
+ |'check'
+ |'constant'
+ |'default'
+ |'values'
+ |'upper'
+ |'lower'
+ |'nn'|'not null'
+ |'between'
+ |'hidden'|'invisible'
+ |'references'|'reference'
+ |'fk'|'pk' )
+
+datatype::=
+ 'num'|'number'
+ |'int'|'integer'
+ |'d'|'date'
+ |'ts'|'timestamp'
+ |'tstz'|'tswtz'|'timestamp' 'with' 'local' 'time' 'zonechar'
+ |'vc'|'varchar'|'varchar2'|'string'
+ |'vc' integer | 'vc' '(' integer ')'
+ | 'vc32k'
+ | 'clob'|'blob'|'jsonfile'
+
+individual_setting::=
+ ( 'apex'|'api'|'audit'
+ |'cols'|'compress'|'createdbycol'|'createdcol'
+ |'date'|'db'|'drop'
+ |'language'|'longvc'
+ |'ondelete'|'overridesettings'
+ |'pk'|'prefix'|'prefixpkwithtname'
+ |'genpk'
+ |'resetsettings'|'rowkey'
+ |'tenantid'|'rowversion'
+ |'schema'|'semantics'
+ |'updatedbycol'|'updatedcolverbose' ) ':' (string_literal| 'true' | 'false')
+```
diff --git a/doc/quicksql.md b/doc/quicksql.md
deleted file mode 100644
index 9958b14..0000000
--- a/doc/quicksql.md
+++ /dev/null
@@ -1,266 +0,0 @@
-# Quick SQL Grammar
-
-# Table of Contents
-1. [Datatypes](#datatypes)
-2. [Table Directives](#table-directives)
-3. [Column Directives](#column-Directives)
-4. [Views](#views)
-5. [Settings](#settings)
-6. [Grammar](#grammar)
-
-
-# Datatypes
-| Type | DB Type |
-| -------- | ------- |
-| num, number | NUMBER |
-| int, integer | INTEGER |
-| d, date | Date |
-| ts, timestamp | TIMESTAMP |
-| tstz, tswtz, timestamp with local time zone | TIMESTAMP WITH LOCAL TIMEZONE |
-| char, vc, varchar, varchar2, string | Varchar2(4000) |
-| vcNNN,vc(NNN) | Varchar2(NNN) |
-| vc32k | Varchar2(32767) |
-| clob | clob |
-| blob | blob |
-|json | CLOB CHECK ( IS JSON) |
-| file | Adds a BLOB column and _FILENAME, _CHARSET, _MIMETYPE, _LASTUPD columns that enhance the ability for file download via a browser |
-
-# Table Directives
-| Directive | Description |
-| -------- | ------- |
-| /api | enerate PL/SQL package API to query, insert, update, and delete data within a table. Adds Oracle auditing, by default AUDIT ALL ON [TABLE NAME]. |
-| /audit | Adds Oracle auditing, by default AUDIT ALL ON [TABLE NAME].|
-| /auditcols, /audit cols, /audit columns | Automatically adds an UPDATED, UPDATED_BY, INSERTED, and INSERTED_BY columns and the trigger logic to set column values. |
-| /colprefix | Prefix all columns of a given table with this value. Automatically adds an underscore if not provided. |
-| /compress, /compressed | Table will be created compressed. |
-| /insert NN | Generate NN SQL INSERT statement(s) with random data, for example: /INSERT 20. (Maximum = 1000) |
-| /rest | Generate REST enablement of the table using Oracle REST Data Services (ORDS) |
-| /select | Generate SQL SELECT statement after generating data for each table |
-| /unique | Generate table level unique constraint |
-
-
-
-# Column Directives
-| Directive | Description |
-| -------- | ------- |
-| /idx, /index, /indexed | Creates a non unique index |
-| /unique | Creates a unique constraint |
-| /check | Creates a check constraint with comma or white space delimited values e.g. /check Yes, No |
-| /constant | When generating data set this column to a constant value. For example /constant NYC. |
-| /default | Adds default value if the column is null |
-| /values | Comma separated list of values to use when generating data. For example /values 1, 2, 3, 4 or /values Yes, No. |
-| /upper | Forces column values to upper case |
-| /lower | Forces column values to lower case |
-| /nn, /not null | Adds a not null constraint on the column |
-| /between | Adds a between check constraint on the column, for example /between 1 and 100 |
-| /hidden, /invisible | Hidden columns are not displayed using select * from table. |
-| /references, /reference, /fk | Foreign key references e.g. /references table_name. Note you can reference tables that are not part of your model. |
-| /pk | Identifies column as the primary key of the table. It is recommended not manually specify primary keys and let this app create primary key columns automatically. |
-| --, [ comments ] | Enclose comments using square brackets or using dash dash syntax |
-
-# Views
-### Syntax:
-`view [view_name] [table name] [table name]...`
-
-Ensure the view name contains no spaces, ensure the table names contain no spaces. Delimit table names by a space or comma.
-### Example:
-`dept dname loc emp ename job view dept_emp emp dept`
-
-This syntax restricts views to conjunctive queries (i.e. containing equijoin predicates) only.
-
-# Settings
-
-You can enter inline settings to explicitly set SQL syntax generation options. Alternatively, you can click Settings at the top of the right pane to
-declaratively set the generation options.
-
-Entering settings directly into the Quick SQL Shorthand pane ensures the same SQL generation options are utilized even if you download the script and later paste it back. For example, enter the following to prefix all table names with TEST and generate for schema OBE:
-
-`# settings = { prefix: "test", schema: "OBE" }.`
-Alternatively, enter each setting on a separate line for the same result:
-
-`# prefix: "test"`
-
-`# schema: "OBE"`
-
-Note: The settings must start on a new line and begin with # settings = to enter multiple settings, or # to enter a single setting per line. All values are case insensitive. Brackets, spaces, and commas can be added for clarity but are ignored. To have all settings generated use # verbose: true.
-
-
-#### ` # apex: true | false `
-##### Default : false
-This setting controls the syntax generated to support audit columns. Specifically if audit columns are enabled triggers are generated to maintain the user creating a row and the user last updating a row. When enabled the following function is used:
-
-`coalesce(sys_context('APEX$SESSION','APP_USER'),user)`
-
-When not enabled the following function is used: `user`
-
-
-
-#### `# api: true | false`
-##### Default : false
-Generate PL/SQL APIs on all tables for create, insert, update, delete and query.
-
-#### `# auditcols: true | false`
-##### Default : false
-Adds an additional created, created_by, updated and updated_by columns to every table created.
-
-#### `# compress: true | false`
-##### Default : false
-When enabled creates all tables compressed.
-
-#### `# createdByCol: "created_by_user"`
-##### Default : created_by
-When Audit Columns are enabled the default column used to track the user who created a row is CREATED_BY. Use this setting to override default audit column name.
-
-#### `# createdCol: "created_date"`
-##### Default : created
-When Audit Columns are enabled the default column used to track the user who created a row is CREATED. Use this setting to override default audit column name.
-
-#### `# date: "timestamp with local time zone"`
-##### Default : date
-By default all DATE columns created using the Oracle DATE datatype. Use this setting to override this default. Valid values are:
-date, timestamp, timestamp with time zone,TSWTZ, timestamp with local time zone, TSWLTZ.
-
-#### `# db: "19c"`
-##### Default : 21c
-Specifies the database version the syntax should be compatible with. Valid values are: **11g**, **12c**, **19c**, **21c**
-
-#### `# drop: true| false`
-##### Default : false
-Include SQL commands to drop each database object created.
-
-#### `# language: "EN"`
-##### Default : EN
-Generate data used for insert statements using this language. The default is English. Supported languages include: **EN**, **DE**, **KO**, **JA**
-
-#### `# longVC: true| false`
-##### Default : false
-Allow longer identifiers to be used for database object names. Longer identifiers allow the maximum length a VARCHAR2 column datatype will be 32767 characters. When not set the maximum length of a VARCHAR2 column datatype will be 4000 characters.
-
-#### `# ondelete: "cascade"`
-##### Default : false
-This setting controls how foreign key ON DELETE settings. Valid values include: **cascade**, **restrict**, **set null**
-
-#### `# overrideSettings: true| false`
-##### Default : false
-When enabled all application settings set via the user interface console are ignored and only settings set in the script will be used.
-
-#### `# PK: "identity"`
-##### Default : identity
-Determines how the primary key will be set. Primary keys can be set using SYS_GUID, identity column or sequence. Valid values include:**guid**, **seq**, **identity**, **none**
-
-#### `# prefix: "foo"`
-##### Default :
-Database object prefix. An underscore will be appended if not provided.
-
-#### `# prefixPKwithTname: true | false `
-##### Default : false
-Prefix primary key database table columns with name of table. For example the primary key of the EMPLOYEE table would be EMPLOYEE_ID. Without setting the name of implicitly created primary key columns will be ID.
-
-#### `# genPK: true | false `
-##### Default : true
-Prefix primary key database table columns with name of table. For example the primary key of the EMPLOYEE table would be EMPLOYEE_ID. Without setting the name of implicitly created primary key columns will be ID.
-
-#### `# resetsettings `
-##### Default :
-Resets all application settings to default values. When included all application settings currently active for your session will be ignored.
-
-#### `# rowkey: true | false `
-##### Default : false
-For each table created add a ROW_KEY column that generates an alphanumeric identifier. Values of the ROW_KEY column will be set by generated database table trigger logic.
-
-#### `# tenantID: true | false `
-##### Default : false
-For each table add a TENANT_ID column to support mutil-tenant applications. The value of this column is simply added to the table, maintaining this value will need to be provided by the developer.
-
-#### `# rowVersion: true | false`
-##### Default : false
-For each table generated add a ROW_VERSION column that increments by 1 for each update. When enabled database table trigger logic will be generated to increment row versions on update.
-
-#### `# schema: "scott"`
-##### Default :
-Prefix object names with a schema name. The default is no schema prefix for object names.
-
-#### `# semantics: "char"`
-##### Default :
-You can choose no column semantics, or **BYTE** or **CHAR** semantics.
-Examples:
-
-`varchar2(4000), varchar2(4000 byte), varchar2(4000 char)`
-
-
-#### `# updatedByCol: "updated_by_user"`
-##### Default : updated_ by
-When enabling audit columns use this setting to override default audit column name.
-
-#### `# updatedCol: "updated_dt"`
-##### Default : updated
-When enabling audit columns use this setting to override default audit column name.
-
-#### `# verbose: true | false`
-##### Default : false
-Show all settings, not just settings that are different from the default.
-
-
-## Grammar
-```
- qddl::= stmt+
-stmt::= tree
- | view
- | '#' individual_setting
- | 'settings' '=' '{' individual_setting ( ',' individual_setting )* '}'
-view::= 'view' view_name table_name+
-view_name::= identifier
-table_name::= identifier
-column_name::= identifier
-tree::= node+
-
- tableNode::= indentation tableName tableDirective*
-columnNode::= indentation columnName columnDirective* datatype*
-indentation::= INDENT | DEDENT | SAMELEVEL
-tableDirective::= '/'
- ('api'
- |'audit'|'auditcols'|'audit cols'|'audit columns'
- |'colprefix'
- |'compress'|'compressed'
- |'insert' integer
- |'rest'
- |'select'
- |'unique' )
-columnDirective::= '/'
- ('idx'|'index'|'indexed'
- |'unique'
- |'check'
- |'constant'
- |'default'
- |'values'
- |'upper'
- |'lower'
- |'nn'|'not null'
- |'between'
- |'hidden'|'invisible'
- |'references'|'reference'
- |'fk'|'pk' )
-datatype::=
- 'num'|'number'
- |'int'|'integer'
- |'d'|'date'
- |'ts'|'timestamp'
- |'tstz'|'tswtz'|'timestamp' 'with' 'local' 'time' 'zonechar'
- |'vc'|'varchar'|'varchar2'|'string'
- |'vc' integer | 'vc' '(' integer ')'
- | 'vc32k'
- | 'clob'|'blob'|'jsonfile'
-individual_setting::=
- ( 'apex'|'api'|'audit'
- |'cols'|'compress'|'createdbycol'|'createdcol'
- |'date'|'db'|'drop'
- |'language'|'longvc'
- |'ondelete'|'overridesettings'
- |'pk'|'prefix'|'prefixpkwithtname'
- |'genpk'
- |'resetsettings'|'rowkey'
- |'tenantid'|'rowversion'
- |'schema'|'semantics'
- |'updatedbycol'|'updatedcolverbose' ) ':' (string_literal| 'true' | 'false')
-```
-
\ No newline at end of file
diff --git a/package.json b/package.json
index 44c8d26..b746771 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "@oracle/quicksql",
- "version": "1.1.2",
- "description": "Quick SQL to DDL translator and GUI",
+ "version": "1.1.3",
+ "description": "Quick SQL to DDL and ERD translator",
"main": "src/index.js",
"type": "module",
"engines": {
@@ -18,12 +18,14 @@
"prebuild": "rm -f ./dist/*",
"build:ddl": "TARGET_LIBRARY=DDL vite build",
"build:erd": "TARGET_LIBRARY=ERD vite build",
- "test": "echo \"running test...\" && ./test/regression_test.js",
- "example-cli": "echo \"running example...\" && ./examples/cli.js ./test/project_management.quicksql"
+ "test": "./test/regression_test.js",
+ "lint:markdown": "markdownlint-cli2 *.md, doc/**/*.md",
+ "lint": "run-p lint:*",
+ "example-cli": "./examples/cli.js ./test/project_management.quicksql"
},
"repository": {
"type": "git",
- "url": "git+https://github.com/oracle/quick-sql.git"
+ "url": "git+https://github.com/oracle/quicksql.git"
},
"keywords": [
"Oracle",
@@ -42,6 +44,7 @@
},
"devDependencies": {
"eslint": "^8.42.0",
+ "markdownlint-cli2": "^0.10.0",
"npm-run-all": "^4.1.5",
"vite": "^4.4.4"
}