@dreamtree-org/korm-js 1.0.31 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const{getDefaultTypeSize:getDefaultTypeSize,getDbType:getDbType}=require("./DataTypeMap");class BaseUtility{getModel(e,t){let n=e?.schema,l=null,r=Object.keys(n);if(r.forEach(e=>{e===t&&(l=n[e])}),l||r.forEach(e=>{let r=n[e];r.table===t&&(l=r)}),l)return{...l,name:t,columns:Object.keys(l.columns).map(e=>{let t=l.columns[e];return this.parseColumnString(e,t)})};throw new Error(`Model ${t} not found`)}map2DbDefault(e){return"now"===e?"CURRENT_TIMESTAMP":e}getCollenedValue(e,{splitChar:t=":",give:n="right",trimWrap:l="{}"}={}){if(null==e)return null;const r=String(e),i=r.indexOf(t),a=e=>{if(!l)return e;if("string"==typeof l&&2===l.length){const[t,n]=l;return e.startsWith(t)&&e.endsWith(n)?e.slice(1,-1):e}return"string"==typeof l&&l.length&&e.startsWith(l)&&e.endsWith(l)?e.slice(l.length,-l.length):e};if(i>=0){const e=r.slice(0,i).trim(),l=r.slice(i+t.length).trim();return"both"===n?{left:a(e),right:a(l)}:a("left"===n?e:l)}return a(r)}parseForeignKey(e){if(!e)return{foreignMapTables:[]};const t=this.getCollenedValue(e),[n,l="id"]=String(t||"").split(":"),r=(this.getCollenedValue(n)||"").split(",").filter(Boolean),i=(this.getCollenedValue(l)||"").split(",").filter(Boolean);return{foreignMapTables:r.map((e,t)=>({table:e,column:i[t]||i[0]||"id"}))}}parseColumnString(e,t){const[n,...l]=String(t).split("|"),r=e=>l.find(t=>t.startsWith(e+":")),i=e=>l.join("|").includes(e),a=e=>e&&e.includes(":")?e.slice(e.indexOf(":")+1):null,s=r("default"),u=r("onUpdate"),o=r("comment"),g=r("foreignKey"),m=r("size"),p=this.parseForeignKey(g),c=!!g,E=getDbType(n,m?a(m):null),f=m?a(m):getDefaultTypeSize(E);return{name:e,type:E,size:f,isUnsigned:i("unsigned")||i("primaryKey")||c,columnType:`${n}${f?`(${f})`:""}`,nullable:!i("notNull"),primary:i("primaryKey"),autoIncrement:i("autoIncrement"),unique:i("unique"),default:this.map2DbDefault(a(s)),onUpdate:this.map2DbDefault(a(u)),comment:a(o)||"",hasForeignKey:c,...p}}formatColumnSchema(e,t){return this.parseColumnString(e,t)}formatColumnDef(e,t){return{name:e,type:t.DATA_TYPE,size:t.CHARACTER_MAXIMUM_LENGTH||getDefaultTypeSize(t.DATA_TYPE),isUnsigned:String(t.COLUMN_TYPE||"").toLowerCase().includes("unsigned"),columnType:t.COLUMN_TYPE,nullable:"YES"===t.IS_NULLABLE,primary:"PRI"===t.COLUMN_KEY,unique:"UNI"===t.COLUMN_KEY,autoIncrement:String(t.EXTRA||"").toLowerCase().includes("auto_increment"),hasForeignKey:"MUL"===t.COLUMN_KEY,comment:t.COMMENT,default:t.COLUMN_DEFAULT,onUpdate:((e="")=>{const t=String(e).match(/on update\s+([a-zA-Z_]+)/i);return t?t[1]:null})(t.EXTRA),foreignMapTables:"MUL"===t.COLUMN_KEY&&t.REFERENCED_TABLE_NAME?[{table:t.REFERENCED_TABLE_NAME,column:t.REFERENCED_COLUMN_NAME}]:[]}}escapeComment(e){return null==e?"":String(e).replace(/'/g,"\\'")}}module.exports=BaseUtility;
1
+ const{getDefaultTypeSize:getDefaultTypeSize,getDbType:getDbType}=require("./DataTypeMap");class BaseUtility{getModel(e,t){let n=e?.schema,l=null,r=Object.keys(n);if(r.forEach(e=>{e===t&&(l=n[e])}),l||r.forEach(e=>{let r=n[e];r.table===t&&(l=r)}),l)return{...l,name:t,columns:Object.keys(l.columns).map(e=>{let t=l.columns[e];return this.parseColumnString(e,t)})};throw new Error(`Model ${t} not found`)}map2DbDefault(e){return"now"===e?"CURRENT_TIMESTAMP":e}getCollenedValue(e,{splitChar:t=":",give:n="right",trimWrap:l="{}"}={}){if(null==e)return null;const r=String(e),i=r.indexOf(t),a=e=>{if(!l)return e;if("string"==typeof l&&2===l.length){const[t,n]=l;return e.startsWith(t)&&e.endsWith(n)?e.slice(1,-1):e}return"string"==typeof l&&l.length&&e.startsWith(l)&&e.endsWith(l)?e.slice(l.length,-l.length):e};if(i>=0){const e=r.slice(0,i).trim(),l=r.slice(i+t.length).trim();return"both"===n?{left:a(e),right:a(l)}:a("left"===n?e:l)}return a(r)}parseForeignKey(e){if(!e)return{foreignMapTables:[]};const t=this.getCollenedValue(e),[n,l="id"]=String(t||"").split(":"),r=(this.getCollenedValue(n)||"").split(",").filter(Boolean),i=(this.getCollenedValue(l)||"").split(",").filter(Boolean);return{foreignMapTables:r.map((e,t)=>({table:e,column:i[t]||i[0]||"id"}))}}parseColumnString(e,t){const[n,...l]=String(t).split("|"),r=e=>l.find(t=>t.startsWith(e+":")),i=e=>l.join("|").includes(e),a=e=>e&&e.includes(":")?e.slice(e.indexOf(":")+1):null,u=r("default"),s=r("onUpdate"),o=r("comment"),g=r("foreignKey"),p=r("size"),m=this.parseForeignKey(g),c=!!g,E=getDbType(n,p?a(p):null),f=p?a(p):getDefaultTypeSize(E);return{name:e,type:E,size:f,isUnsigned:i("unsigned")||i("primaryKey")||c,columnType:`${n}${f?`(${f})`:""}`,nullable:!i("notNull"),primary:i("primaryKey"),autoIncrement:i("autoIncrement"),unique:i("unique"),default:this.map2DbDefault(a(u)),onUpdate:this.map2DbDefault(a(s)),comment:a(o)||"",hasForeignKey:c,...m}}formatColumnSchema(e,t){return this.parseColumnString(e,t)}formatColumnDef(e,t){return{name:e,type:t.DATA_TYPE,size:t.CHARACTER_MAXIMUM_LENGTH||getDefaultTypeSize(t.DATA_TYPE),isUnsigned:String(t.COLUMN_TYPE||"").toLowerCase().includes("unsigned"),columnType:t.COLUMN_TYPE,nullable:"YES"===t.IS_NULLABLE,primary:"PRI"===t.COLUMN_KEY,unique:"UNI"===t.COLUMN_KEY,autoIncrement:String(t.EXTRA||"").toLowerCase().includes("auto_increment"),hasForeignKey:"MUL"===t.COLUMN_KEY,comment:t.COMMENT,default:t.COLUMN_DEFAULT,onUpdate:((e="")=>{const t=String(e).match(/on update\s+([a-zA-Z_]+)/i);return t?t[1]:null})(t.EXTRA),foreignMapTables:"MUL"===t.COLUMN_KEY&&t.REFERENCED_TABLE_NAME?[{table:t.REFERENCED_TABLE_NAME,column:t.REFERENCED_COLUMN_NAME}]:[]}}escapeComment(e){return null==e?"":String(e).replace(/'/g,"\\'")}getDefaultTypeSize(e){return getDefaultTypeSize(e)}}module.exports=BaseUtility;
@@ -1 +1 @@
1
- const{getDefaultTypeSize:getDefaultTypeSize,getDbType:getDbType}=require("./DataTypeMap");class BaseUtility{isInternalDefault(e){if("string"!=typeof e)return!1;const t=/^CURRENT_TIMESTAMP$/i.test(e),n=/^[a-zA-Z_][a-zA-Z0-9_]*\s*\(.*\)$/.test(e),r=/::[a-zA-Z0-9_]+/.test(e);return t||n||r}getModel(e,t){let n=e?.schema,r=null,l=Object.keys(n);if(l.forEach(e=>{e===t&&(r=n[e])}),r||l.forEach(e=>{let l=n[e];l.table===t&&(r=l)}),r)return{...r,name:t,columns:Object.keys(r.columns).map(e=>{let t=r.columns[e];return this.parseColumnString(e,t)})};throw new Error(`Model ${t} not found`)}map2DbDefault(e){return"now"===e?"CURRENT_TIMESTAMP":e}getCollenedValue(e,{splitChar:t=":",give:n="right",trimWrap:r="{}"}={}){if(null==e)return null;const l=String(e),i=l.indexOf(t),a=e=>{if(!r)return e;if("string"==typeof r&&2===r.length){const[t,n]=r;return e.startsWith(t)&&e.endsWith(n)?e.slice(1,-1):e}return"string"==typeof r&&r.length&&e.startsWith(r)&&e.endsWith(r)?e.slice(r.length,-r.length):e};if(i>=0){const e=l.slice(0,i).trim(),r=l.slice(i+t.length).trim();return"both"===n?{left:a(e),right:a(r)}:a("left"===n?e:r)}return a(l)}parseForeignKey(e){if(!e)return{foreignMapTables:[]};const t=this.getCollenedValue(e),[n,r="id"]=String(t||"").split(":"),l=(this.getCollenedValue(n)||"").split(",").filter(Boolean),i=(this.getCollenedValue(r)||"").split(",").filter(Boolean);return{foreignMapTables:l.map((e,t)=>({table:e,column:i[t]||i[0]||"id"}))}}parseColumnString(e,t){const[n,...r]=String(t).split("|"),l=e=>r.find(t=>t.startsWith(e+":")),i=e=>r.join("|").includes(e),a=e=>e&&e.includes(":")?e.slice(e.indexOf(":")+1):null,s=l("default"),u=l("onUpdate"),o=l("comment"),g=l("foreignKey"),p=l("size"),E=this.parseForeignKey(g),m=!!g,T=getDbType(n,p?a(p):null),c=p?a(p):getDefaultTypeSize(T);return{name:e,type:T,size:+c,isUnsigned:i("unsigned")||i("primaryKey")||m,columnType:`${n}${c?`(${c})`:""}`,nullable:!i("notNull"),primary:i("primaryKey"),autoIncrement:i("autoIncrement"),unique:i("unique"),default:this.map2DbDefault(a(s)),onUpdate:this.map2DbDefault(a(u)),comment:a(o)||"",hasForeignKey:m,...E}}formatColumnSchema(e,t){return this.parseColumnString(e,t)}formatColumnDef(e,t){return{name:e,type:t.DATA_TYPE,size:+(t.CHARACTER_MAXIMUM_LENGTH||getDefaultTypeSize(t.DATA_TYPE)),isUnsigned:String(t.COLUMN_TYPE||"").toLowerCase().includes("unsigned"),columnType:t.COLUMN_TYPE,nullable:"YES"===t.IS_NULLABLE,primary:"PRIMARY KEY"===t.CONSTRAINT_TYPE,unique:"UNIQUE"===t.CONSTRAINT_TYPE,autoIncrement:String(t.EXTRA||"").toLowerCase().includes("auto_increment"),hasForeignKey:"FOREIGN KEY"===t.CONSTRAINT_TYPE,comment:t.COMMENT||"",default:t.COLUMN_DEFAULT,onUpdate:((e="")=>{const t=String(e).match(/on update\s+([a-zA-Z_]+)/i);return t?t[1]:null})(t.EXTRA),foreignMapTables:"FOREIGN KEY"===t.CONSTRAINT_TYPE&&t.REFERENCED_TABLE_NAME?[{table:t.REFERENCED_TABLE_NAME,column:t.REFERENCED_COLUMN_NAME}]:[]}}escapeComment(e){return null==e?"":String(e).replace(/'/g,"\\'")}}module.exports=BaseUtility;
1
+ const{getDefaultTypeSize:getDefaultTypeSize,getDbType:getDbType}=require("./DataTypeMap");class BaseUtility{isInternalDefault(e){if("string"!=typeof e)return!1;const t=/^CURRENT_TIMESTAMP$/i.test(e),n=/^[a-zA-Z_][a-zA-Z0-9_]*\s*\(.*\)$/.test(e),r=/::[a-zA-Z0-9_]+/.test(e);return t||n||r}getModel(e,t){let n=e?.schema,r=null,l=Object.keys(n);if(l.forEach(e=>{e===t&&(r=n[e])}),r||l.forEach(e=>{let l=n[e];l.table===t&&(r=l)}),r)return{...r,name:t,columns:Object.keys(r.columns).map(e=>{let t=r.columns[e];return this.parseColumnString(e,t)})};throw new Error(`Model ${t} not found`)}map2DbDefault(e){return"now"===e?"CURRENT_TIMESTAMP":e}getCollenedValue(e,{splitChar:t=":",give:n="right",trimWrap:r="{}"}={}){if(null==e)return null;const l=String(e),i=l.indexOf(t),a=e=>{if(!r)return e;if("string"==typeof r&&2===r.length){const[t,n]=r;return e.startsWith(t)&&e.endsWith(n)?e.slice(1,-1):e}return"string"==typeof r&&r.length&&e.startsWith(r)&&e.endsWith(r)?e.slice(r.length,-r.length):e};if(i>=0){const e=l.slice(0,i).trim(),r=l.slice(i+t.length).trim();return"both"===n?{left:a(e),right:a(r)}:a("left"===n?e:r)}return a(l)}parseForeignKey(e){if(!e)return{foreignMapTables:[]};const t=this.getCollenedValue(e),[n,r="id"]=String(t||"").split(":"),l=(this.getCollenedValue(n)||"").split(",").filter(Boolean),i=(this.getCollenedValue(r)||"").split(",").filter(Boolean);return{foreignMapTables:l.map((e,t)=>({table:e,column:i[t]||i[0]||"id"}))}}parseColumnString(e,t){const[n,...r]=String(t).split("|"),l=e=>r.find(t=>t.startsWith(e+":")),i=e=>r.join("|").includes(e),a=e=>e&&e.includes(":")?e.slice(e.indexOf(":")+1):null,s=l("default"),u=l("onUpdate"),o=l("comment"),g=l("foreignKey"),p=l("size"),T=this.parseForeignKey(g),E=!!g,m=getDbType(n,p?a(p):null),c=p?a(p):getDefaultTypeSize(m);return{name:e,type:m,size:+c,isUnsigned:i("unsigned")||i("primaryKey")||E,columnType:`${n}${c?`(${c})`:""}`,nullable:!i("notNull"),primary:i("primaryKey"),autoIncrement:i("autoIncrement"),unique:i("unique"),default:this.map2DbDefault(a(s)),onUpdate:this.map2DbDefault(a(u)),comment:a(o)||"",hasForeignKey:E,...T}}formatColumnSchema(e,t){return this.parseColumnString(e,t)}formatColumnDef(e,t){return{name:e,type:t.DATA_TYPE,size:+(t.CHARACTER_MAXIMUM_LENGTH||getDefaultTypeSize(t.DATA_TYPE)),isUnsigned:String(t.COLUMN_TYPE||"").toLowerCase().includes("unsigned"),columnType:t.COLUMN_TYPE,nullable:"YES"===t.IS_NULLABLE,primary:"PRIMARY KEY"===t.CONSTRAINT_TYPE,unique:"UNIQUE"===t.CONSTRAINT_TYPE,autoIncrement:String(t.EXTRA||"").toLowerCase().includes("auto_increment"),hasForeignKey:"FOREIGN KEY"===t.CONSTRAINT_TYPE,comment:t.COMMENT||"",default:t.COLUMN_DEFAULT,onUpdate:((e="")=>{const t=String(e).match(/on update\s+([a-zA-Z_]+)/i);return t?t[1]:null})(t.EXTRA),foreignMapTables:"FOREIGN KEY"===t.CONSTRAINT_TYPE&&t.REFERENCED_TABLE_NAME?[{table:t.REFERENCED_TABLE_NAME,column:t.REFERENCED_COLUMN_NAME}]:[]}}escapeComment(e){return null==e?"":String(e).replace(/'/g,"\\'")}getDefaultTypeSize(e){return getDefaultTypeSize(e)}}module.exports=BaseUtility;
@@ -1 +1 @@
1
- class BaseUtility{getModel(e,t){let n=e?.schema,r=null,i=Object.keys(n);if(i.forEach(e=>{e===t&&(r=n[e])}),r||i.forEach(e=>{let i=n[e];i.table===t&&(r=i)}),r)return{...r,name:t,columns:Object.keys(r.columns).map(e=>{let t=r.columns[e];return this.parseColumnString(e,t)})};throw new Error(`Model ${t} not found`)}getDefaultTypeSize(e,t="toUpperCase"){let n=e;switch(n?.[t]&&"function"==typeof n[t]&&(n=n[t]()),n){case"VARCHAR":return 255;case"TINYINT":return 1;case"INT":return 11;default:return 0}}map2DbType(e,t="toLowerCase"){let n;switch(e){case"number":n="INT";break;case"string":default:n="VARCHAR";break;case"boolean":n="TINYINT";break;case"date":n="DATETIME";break;case"json":n="JSON"}return n?.[t]&&"function"==typeof n[t]&&(n=n[t]()),n}map2DbDefault(e){return"now"===e?"CURRENT_TIMESTAMP":e}getCollenedValue(e,{splitChar:t=":",give:n="right",trimWrap:r="{}"}={}){if(null==e)return null;const i=String(e),l=i.indexOf(t),a=e=>{if(!r)return e;if("string"==typeof r&&2===r.length){const[t,n]=r;return e.startsWith(t)&&e.endsWith(n)?e.slice(1,-1):e}return"string"==typeof r&&r.length&&e.startsWith(r)&&e.endsWith(r)?e.slice(r.length,-r.length):e};if(l>=0){const e=i.slice(0,l).trim(),r=i.slice(l+t.length).trim();return"both"===n?{left:a(e),right:a(r)}:a("left"===n?e:r)}return a(i)}parseForeignKey(e){if(!e)return{foreignMapTables:[]};const t=this.getCollenedValue(e),[n,r="id"]=String(t||"").split(":"),i=(this.getCollenedValue(n)||"").split(",").filter(Boolean),l=(this.getCollenedValue(r)||"").split(",").filter(Boolean);return{foreignMapTables:i.map((e,t)=>({table:e,column:l[t]||l[0]||"id"}))}}parseColumnString(e,t){const[n,...r]=String(t).split("|"),i=e=>r.find(t=>t.startsWith(e+":")),l=e=>r.join("|").includes(e),a=e=>e&&e.includes(":")?e.slice(e.indexOf(":")+1):null,s=i("default"),u=i("onUpdate"),o=i("comment"),c=i("foreignKey"),m=i("size"),p=this.parseForeignKey(c),g=!!c,f=this.map2DbType(n),E=m?a(m):this.getDefaultTypeSize(f);return{name:e,type:f,size:E,isUnsigned:l("unsigned")||l("primaryKey")||g,columnType:`${n}${E?`(${E})`:""}`,nullable:!l("notNull"),primary:l("primaryKey"),autoIncrement:l("autoIncrement"),unique:l("unique"),default:this.map2DbDefault(a(s)),onUpdate:this.map2DbDefault(a(u)),comment:a(o)||"",hasForeignKey:g,...p}}formatColumnSchema(e,t){return this.parseColumnString(e,t)}formatColumnDef(e,t){return{name:e,type:t.DATA_TYPE,size:t.CHARACTER_MAXIMUM_LENGTH||this.getDefaultTypeSize(t.DATA_TYPE),isUnsigned:String(t.COLUMN_TYPE||"").toLowerCase().includes("unsigned"),columnType:t.COLUMN_TYPE,nullable:"YES"===t.IS_NULLABLE,primary:"PRI"===t.COLUMN_KEY,unique:"UNI"===t.COLUMN_KEY,autoIncrement:String(t.EXTRA||"").toLowerCase().includes("auto_increment"),hasForeignKey:"MUL"===t.COLUMN_KEY,comment:t.COMMENT,default:t.COLUMN_DEFAULT,onUpdate:((e="")=>{const t=String(e).match(/on update\s+([a-zA-Z_]+)/i);return t?t[1]:null})(t.EXTRA),foreignMapTables:"MUL"===t.COLUMN_KEY&&t.REFERENCED_TABLE_NAME?[{table:t.REFERENCED_TABLE_NAME,column:t.REFERENCED_COLUMN_NAME}]:[]}}escapeComment(e){return null==e?"":String(e).replace(/'/g,"\\'")}}module.exports=BaseUtility;
1
+ class BaseUtility{getModel(e,t){let n=e?.schema,r=null,i=Object.keys(n);if(i.forEach(e=>{e===t&&(r=n[e])}),r||i.forEach(e=>{let i=n[e];i.table===t&&(r=i)}),r)return{...r,name:t,columns:Object.keys(r.columns).map(e=>{let t=r.columns[e];return this.parseColumnString(e,t)})};throw new Error(`Model ${t} not found`)}getDefaultTypeSize(e,t="toUpperCase"){let n=e;switch(n?.[t]&&"function"==typeof n[t]&&(n=n[t]()),n){case"VARCHAR":return 255;case"TINYINT":return 1;case"INT":return 11;default:return 0}}map2DbType(e,t="toLowerCase"){let n;switch(e){case"number":n="INT";break;case"string":default:n="VARCHAR";break;case"boolean":n="TINYINT";break;case"date":n="DATETIME";break;case"json":n="JSON"}return n?.[t]&&"function"==typeof n[t]&&(n=n[t]()),n}map2DbDefault(e){return"now"===e?"CURRENT_TIMESTAMP":e}getCollenedValue(e,{splitChar:t=":",give:n="right",trimWrap:r="{}"}={}){if(null==e)return null;const i=String(e),l=i.indexOf(t),a=e=>{if(!r)return e;if("string"==typeof r&&2===r.length){const[t,n]=r;return e.startsWith(t)&&e.endsWith(n)?e.slice(1,-1):e}return"string"==typeof r&&r.length&&e.startsWith(r)&&e.endsWith(r)?e.slice(r.length,-r.length):e};if(l>=0){const e=i.slice(0,l).trim(),r=i.slice(l+t.length).trim();return"both"===n?{left:a(e),right:a(r)}:a("left"===n?e:r)}return a(i)}parseForeignKey(e){if(!e)return{foreignMapTables:[]};const t=this.getCollenedValue(e),[n,r="id"]=String(t||"").split(":"),i=(this.getCollenedValue(n)||"").split(",").filter(Boolean),l=(this.getCollenedValue(r)||"").split(",").filter(Boolean);return{foreignMapTables:i.map((e,t)=>({table:e,column:l[t]||l[0]||"id"}))}}parseColumnString(e,t){const[n,...r]=String(t).split("|"),i=e=>r.find(t=>t.startsWith(e+":")),l=e=>r.join("|").includes(e),a=e=>e&&e.includes(":")?e.slice(e.indexOf(":")+1):null,s=i("default"),u=i("onUpdate"),o=i("comment"),c=i("foreignKey"),p=i("size"),m=this.parseForeignKey(c),g=!!c,f=this.map2DbType(n),E=p?a(p):this.getDefaultTypeSize(f);return{name:e,type:f,size:E,isUnsigned:l("unsigned")||l("primaryKey")||g,columnType:`${n}${E?`(${E})`:""}`,nullable:!l("notNull"),primary:l("primaryKey"),autoIncrement:l("autoIncrement"),unique:l("unique"),default:this.map2DbDefault(a(s)),onUpdate:this.map2DbDefault(a(u)),comment:a(o)||"",hasForeignKey:g,...m}}formatColumnSchema(e,t){return this.parseColumnString(e,t)}formatColumnDef(e,t){return{name:e,type:t.DATA_TYPE,size:t.CHARACTER_MAXIMUM_LENGTH||this.getDefaultTypeSize(t.DATA_TYPE),isUnsigned:String(t.COLUMN_TYPE||"").toLowerCase().includes("unsigned"),columnType:t.COLUMN_TYPE,nullable:"YES"===t.IS_NULLABLE,primary:"PRI"===t.COLUMN_KEY,unique:"UNI"===t.COLUMN_KEY,autoIncrement:String(t.EXTRA||"").toLowerCase().includes("auto_increment"),hasForeignKey:"MUL"===t.COLUMN_KEY,comment:t.COMMENT,default:t.COLUMN_DEFAULT,onUpdate:((e="")=>{const t=String(e).match(/on update\s+([a-zA-Z_]+)/i);return t?t[1]:null})(t.EXTRA),foreignMapTables:"MUL"===t.COLUMN_KEY&&t.REFERENCED_TABLE_NAME?[{table:t.REFERENCED_TABLE_NAME,column:t.REFERENCED_COLUMN_NAME}]:[]}}escapeComment(e){return null==e?"":String(e).replace(/'/g,"\\'")}getDefaultTypeSize(e){return this.getDefaultTypeSize(e)}}module.exports=BaseUtility;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamtree-org/korm-js",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "Knowledge Object-Relational Mapping - A powerful, modular ORM system for Node.js with dynamic database operations, complex queries, relationships, and nested requests",
5
5
  "author": {
6
6
  "name": "Partha Preetham Krishna",