Skip to content

Commit a560b18

Browse files
boolean, one more time
1 parent d9f32c8 commit a560b18

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

dist/quick-sql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7722,7 +7722,7 @@ let me = function() {
77227722
break;
77237723
}
77247724
const k = h.getOptionValue("db");
7725-
M != "" && (h.getOptionValue("boolean") == "native" || 1 < k.length && k.charAt(0) == "2" && k.charAt(1) == "3") && (M = "", b = "boolean"), this.indexOf("phone_number") == 0 && (b = "number");
7725+
M != "" && (h.getOptionValue("boolean") == "native" || h.getOptionValue("boolean") != "yn" && 0 < k.length && k.charAt(0) == "2" && k.charAt(1) == "3") && (M = "", b = "boolean"), this.indexOf("phone_number") == 0 && (b = "number");
77267726
let O = this.indexOf("num", !0);
77277727
0 < O && (b = "number");
77287728
let N = this.indexOf(")");
@@ -8984,7 +8984,7 @@ const j = {
89848984
createdbycol: { label: "Created By Column Name", value: "created_by" },
89858985
updatedcol: { label: "Updated Column Name", value: "updated" },
89868986
updatedbycol: { label: "Updated By Column Name", value: "updated_by" },
8987-
boolean: { label: "Boolean Datatype", value: "yn", check: ["yn", "native"] },
8987+
boolean: { label: "Boolean Datatype", value: "not set", check: ["yn", "native"] },
89888988
genpk: { label: "Auto Primary Key", value: "yes", check: ["yes", "no"] },
89898989
semantics: { label: "Character Strings", value: "CHAR", check: ["BYTE", "CHAR", "Default"] },
89908990
language: { label: "Data Language", value: "EN", check: ["EN", "JP", "KO"] },

dist/quick-sql.umd.cjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

doc/user/quick-sql-grammar.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,10 @@ table created.
232232
### boolean
233233

234234
**Possible Values**: `yn`, `native`
235-
**Default Value**: `yn`
236-
237-
Adds an additional created, created_by, updated and updated_by columns to every
238-
table created.
235+
**Default Value**: inferred from #db
239236

237+
Set boolean to legacy char(1) or new 23c native boolean value. This setting has priority
238+
over db:23c, so that the user can override db seting (which influences other functionality)
240239

241240
### compress
242241

src/ddl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const quicksql = (function () {
2020
createdbycol: {label: 'Created By Column Name', value: 'created_by'},
2121
updatedcol: {label: 'Updated Column Name', value: 'updated'},
2222
updatedbycol: {label: 'Updated By Column Name', value: 'updated_by'},
23-
boolean: {label: 'Boolean Datatype', value:'yn',check:['yn','native']},
23+
boolean: {label: 'Boolean Datatype', value:'not set',check:['yn','native']},
2424
genpk: {label:'Auto Primary Key', value:'yes',check:['yes','no']},
2525
semantics: {label: 'Character Strings',value:'CHAR',check:['BYTE','CHAR','Default']},
2626
language: {label: 'Data Language', value:'EN',check:['EN','JP','KO']},

src/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ let tree = (function(){
336336
}
337337
const dbVer = ddl.getOptionValue('db');
338338
if( booleanCheck != '' && ( ddl.getOptionValue('boolean')=='native'
339-
|| 1 < dbVer.length && dbVer.charAt(0) == '2' && dbVer.charAt(1) == '3' )
339+
|| ddl.getOptionValue('boolean') != 'yn' && 0 < dbVer.length && dbVer.charAt(0) == '2' && dbVer.charAt(1) == '3' )
340340
) {
341341
booleanCheck = '';
342342
ret = 'boolean';

test/small_tests.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,16 @@ students
649649
output = new quicksql(`boolvalues
650650
ok bool
651651
#boolean:native`).getDDL();
652+
console.log(output);
652653
assert( "0 < output.indexOf('ok boolean')" );
653654

655+
output = new quicksql(`boolvalues
656+
ok bool
657+
#boolean:yn
658+
#db:"23c"`).getDDL();
659+
console.log(output);
660+
assert( "output.indexOf('ok boolean') < 0" );
661+
654662
// https://github.com/oracle/quicksql/issues/55
655663
output = new quicksql(`escape /insert 1
656664
financial_year /check '23/24', \`'24/25'\`

0 commit comments

Comments
 (0)