Skip to content

Commit e3571dd

Browse files
Merge pull request #53 from oracle/async-API
issues 47+
2 parents 414f614 + 67984c4 commit e3571dd

19 files changed

+1621
-1594
lines changed

CHANGELOG.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,13 @@ Issues up to #51
2525

2626
Further Json to QSQL parsing progress
2727

28-
Performance optimization: from 12 sec down to 6 sec for 1000 line QSQL schema definition
29-
in test/profile.js. Faster regression test as well.
28+
Performance optimization: from 12 sec down to 4.5 sec for 1000 line QSQL schema definition
29+
in test/profile.js (test for pk-fk chain of 333 tables, 3 column each; 268 ms for chain of
30+
50 tables, 20 columns each).
31+
32+
## [1.2.2] - 2024-2-15
33+
34+
Issue #47
35+
36+
Fixed invalid 'Misaligned Table ...' error, exhibited in vscode QSQL extension (yet to be published).
37+

dist/quick-erd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ class de {
739739
e.rearrangeDiagram(3, !1), this.paperScroller.centerContent();
740740
}
741741
}
742-
const ue = "1.2.1", fe = {
742+
const ue = "1.2.2", fe = {
743743
Diagram: de,
744744
version: ue
745745
};

dist/quick-erd.umd.cjs

+1-1
Large diffs are not rendered by default.

dist/quick-sql.js

+1,227-1,239
Large diffs are not rendered by default.

dist/quick-sql.umd.cjs

+140-147
Large diffs are not rendered by default.

doc/user/quick-sql-grammar.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@
7373
| /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>. |
7474
| /audit | Adds Oracle auditing, by default AUDIT ALL ON <TABLE NAME>. |
7575
| /auditcols, /audit cols, /audit columns | Automatically adds an UPDATED, UPDATED_BY, INSERTED, and INSERTED_BY columns and the trigger logic to set column values. |
76+
| /check | table level constraint |
7677
| /colprefix | Prefix all columns of a given table with this value. Automatically adds an underscore if not provided. |
7778
| /compress, /compressed | Table will be created compressed. |
7879
| /insert NN | Generate NN SQL INSERT statement(s) with random data, for example: /INSERT 20. (Maximum = 1000) |
7980
| /rest | Generate REST enablement of the table using Oracle REST Data Services (ORDS) |
8081
| /select | Generate SQL SELECT statement after generating data for each table |
81-
| /unique | Generate table level unique constraint |
82+
| /unique, /uk | Generate table level unique constraint |
83+
| /pk | Generate primary key constraint (on table level it is usually a composite key) |
8284
<!-- markdownlint-enable MD013 -->
8385

8486
### Star/Snowflake schema relationship direction indicators
@@ -110,7 +112,7 @@ and is usually omitted from QSQL schema definition.
110112
| Directive | Description |
111113
| ------------------------------ | ------------------------------------------ |
112114
| /idx, /index, /indexed | Creates a non unique index |
113-
| /unique | Creates a unique constraint |
115+
| /unique, /uk | Creates a unique constraint |
114116
| /check | Creates a check constraint with comma or white space delimited values e.g. /check Yes, No |
115117
| /constant | When generating data set this column to a constant value. For example /constant NYC. |
116118
| /default | Adds default value if the column is null |
@@ -121,6 +123,9 @@ and is usually omitted from QSQL schema definition.
121123
| /between | Adds a between check constraint on the column, for example /between 1 and 100 |
122124
| /hidden, /invisible | Hidden columns are not displayed using select * from table. |
123125
| /references, /reference, /fk | Foreign key references e.g. /references table_name. Note you can reference tables that are not part of your model. |
126+
| /cascade | on delete cascade |
127+
| /setnull | on delete set null |
128+
| /references, /reference, /fk | Foreign key references e.g. /references table_name. Note you can reference tables that are not part of your model. |
124129
| /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. |
125130
| --, [comments] | Enclose comments using square brackets or using dash dash syntax |
126131
<!-- markdownlint-enable MD013 -->
@@ -429,6 +434,8 @@ stmt::= tree
429434
| 'document' '=' JSON
430435
431436
view::= 'view' view_name table_name+
437+
| view_name '=' table_name+
438+
432439
view_name::= identifier
433440
table_name::= identifier
434441
column_name::= identifier
@@ -452,11 +459,13 @@ tableDirective::= '/'
452459
|'insert' integer
453460
|'rest'
454461
|'select'
455-
|'unique' )
462+
|'unique' | 'uk'
463+
|'pk'
464+
)
456465
457466
columnDirective::= '/'
458467
('idx'|'index'|'indexed'
459-
|'unique'
468+
|'unique'|'uk'
460469
|'check'
461470
|'constant'
462471
|'default'
@@ -467,7 +476,9 @@ columnDirective::= '/'
467476
|'between'
468477
|'hidden'|'invisible'
469478
|'references'|'reference'
470-
|'fk'|'pk' )
479+
|'fk'
480+
|'pk'
481+
)
471482
472483
datatype::=
473484
'num'|'number'

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oracle/quicksql",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Quick SQL to DDL and ERD translator",
55
"main": "./dist/quick-sql.umd.cjs",
66
"module": "./dist/quick-sql.js",

src/ddl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ export const quicksql = (function () {
325325
if( pkNode == null )
326326
continue;
327327
let pk = 'id';
328-
if( pkNode.getExplicitPkNode() != null )
329-
pk = pkNode.getExplicitPkNode().parseName();
328+
if( pkNode.getExplicitPkName() != null )
329+
pk = pkNode.getExplicitPkName();
330330

331331
output.links.push({source: this.objPrefix() +parent, source_id: pk,
332332
target: this.objPrefix() + descendants[i].parseName(''), target_id: fk

src/errorMsgs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function guessIndent( lines ) {
165165
let indent = null;
166166
for( let i in frequencies ) {
167167
if( indent == null || frequencies[indent] <= frequencies[i] )
168-
indent = i;
168+
indent = parseInt(i);
169169
}
170170
return indent;
171171

0 commit comments

Comments
 (0)