@egi/smart-db 2.0.3 → 2.1.0
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.
- package/.eslintrc.json +212 -0
- package/README.md +2 -0
- package/assets/mysql/{database-init.sql → smart-db-core-init.sql} +0 -0
- package/assets/sqlite3/{database-init.sql → smart-db-core-init.sql} +0 -0
- package/bin/copy-assets +6 -0
- package/bin/extract-db-api +19 -0
- package/package.json +57 -28
- package/src/drivers/smart-db-better-sqlite3.ts +284 -0
- package/src/drivers/smart-db-mysql.ts +159 -0
- package/src/drivers/smart-db-mysql2.ts +159 -0
- package/src/drivers/smart-db-sqlite3.ts +198 -0
- package/src/helpers/extract-db-api.ts +465 -0
- package/src/helpers/terser-tree.ts +39 -0
- package/src/models/abstract-model.ts +209 -0
- package/src/models/smart-db-core-table-model.ts +161 -0
- package/src/models/smart-db-dictionary.ts +28 -0
- package/src/models/smart-db-log-model.ts +316 -0
- package/src/models/smart-db-version-model.ts +316 -0
- package/src/models/smart-db-version-view-model.ts +347 -0
- package/src/models/sqlite-master-model.ts +140 -0
- package/src/models/sqlite-sequence-model.ts +91 -0
- package/src/smart-db-api.ts +15 -0
- package/src/smart-db-globals.ts +136 -0
- package/src/smart-db-interfaces.ts +218 -0
- package/src/smart-db-log.ts +262 -0
- package/src/smart-db-sql-build-data.ts +28 -0
- package/src/smart-db-upgrade-manager.ts +171 -0
- package/src/smart-db.ts +854 -0
- package/test/data/sql-engine-tests.json +232 -0
- package/test/db/mysql/database-init.sql +11 -0
- package/test/db/sqlite3/database-init.sql +11 -0
- package/test/exer.js +28 -0
- package/test/model/smart-db-dictionary.ts +19 -0
- package/test/model/test-table-model.ts +214 -0
- package/test/test.js +273 -0
- package/test/test2.js +252 -0
- package/tsconfig.json +32 -0
- package/tsconfig.pro.json +32 -0
- package/tsconfig.test-model.json +23 -0
- package/bin/extract-db-interface +0 -18
- package/drivers/smart-db-better-sqlite3.d.ts +0 -34
- package/drivers/smart-db-better-sqlite3.js +0 -1
- package/drivers/smart-db-mysql.d.ts +0 -24
- package/drivers/smart-db-mysql.js +0 -1
- package/drivers/smart-db-mysql2.d.ts +0 -24
- package/drivers/smart-db-mysql2.js +0 -1
- package/drivers/smart-db-sqlite3.d.ts +0 -28
- package/drivers/smart-db-sqlite3.js +0 -1
- package/helpers/extract-db-interface.d.ts +0 -1
- package/helpers/extract-db-interface.js +0 -1
- package/index.d.ts +0 -10
- package/index.js +0 -1
- package/model/abstract-model.d.ts +0 -44
- package/model/abstract-model.js +0 -1
- package/model/smart-db-core-table-model.d.ts +0 -33
- package/model/smart-db-core-table-model.js +0 -1
- package/model/smart-db-dictionary.d.ts +0 -15
- package/model/smart-db-dictionary.js +0 -1
- package/model/smart-db-log-model.d.ts +0 -63
- package/model/smart-db-log-model.js +0 -1
- package/model/smart-db-version-model.d.ts +0 -63
- package/model/smart-db-version-model.js +0 -1
- package/model/smart-db-version-view-model.d.ts +0 -70
- package/model/smart-db-version-view-model.js +0 -1
- package/model/sqlite-master-model.d.ts +0 -29
- package/model/sqlite-master-model.js +0 -1
- package/model/sqlite-sequence-model.d.ts +0 -24
- package/model/sqlite-sequence-model.js +0 -1
- package/smart-db-interface.d.ts +0 -173
- package/smart-db-interface.js +0 -1
- package/smart-db-log.d.ts +0 -32
- package/smart-db-log.js +0 -1
- package/smart-db-upgrade-manager.d.ts +0 -13
- package/smart-db-upgrade-manager.js +0 -1
- package/smart-db.d.ts +0 -74
- package/smart-db.js +0 -1
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SmartDb } from "../smart-db";
|
|
2
|
-
import Mysql, { Connection, ConnectionConfig } from "mysql";
|
|
3
|
-
import { SmartDbRunResult, SmartDbSqlBuildData, SmartDbTableInfo } from "../smart-db-interface";
|
|
4
|
-
import { AbstractModel } from "..";
|
|
5
|
-
export declare class SmartDbMysql extends SmartDb {
|
|
6
|
-
protected db: Mysql.Connection;
|
|
7
|
-
constructor(connectorOrDb: string | ConnectionConfig | Connection);
|
|
8
|
-
getDatabaseType(): string;
|
|
9
|
-
getDbConnector(): string | Mysql.ConnectionConfig;
|
|
10
|
-
getDbQuote(): string;
|
|
11
|
-
close(): Promise<void>;
|
|
12
|
-
closeSync(): boolean;
|
|
13
|
-
exists<T extends AbstractModel>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): Promise<boolean>;
|
|
14
|
-
existsSync<T extends AbstractModel>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): boolean;
|
|
15
|
-
exec(script: string): Promise<void>;
|
|
16
|
-
execSync(script: string): boolean;
|
|
17
|
-
protected statementGet(buildData: SmartDbSqlBuildData): Promise<any>;
|
|
18
|
-
getTableInfo(table: string): Promise<SmartDbTableInfo>;
|
|
19
|
-
protected statementGetSync(buildData: SmartDbSqlBuildData): any;
|
|
20
|
-
protected statementGetAll(buildData: SmartDbSqlBuildData): Promise<any[]>;
|
|
21
|
-
protected statementGetAllSync(buildData: SmartDbSqlBuildData): any[];
|
|
22
|
-
protected statementRun(buildData: SmartDbSqlBuildData): Promise<SmartDbRunResult>;
|
|
23
|
-
protected statementRunSync(buildData: SmartDbSqlBuildData): SmartDbRunResult;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});var smart_db_1=require("../smart-db"),mysql_1=__importDefault(require("mysql")),_=__importStar(require("lodash")),SmartDbMysql=function(n){function t(t){var e=this;return t.config&&t.connect?(e=n.call(this,t.config)||this).db=t:(e=n.call(this,t)||this).db=mysql_1.default.createConnection(t),e}return __extends(t,n),t.prototype.getDatabaseType=function(){return"mysql"},t.prototype.getDbConnector=function(){return this.dbConnector},t.prototype.getDbQuote=function(){return"`"},t.prototype.close=function(){var t=this;return new Promise(function(e,n){t.db.end(function(t){t?n(t):e()})})},t.prototype.closeSync=function(){throw new Error("Method not implemented.")},t.prototype.exists=function(e,t,n){var i=this;return new Promise(function(o,r){var t=_.isString(e)?e:e.getTableName();i.db.query("show tables like '"+t+"'",function(t,e,n){t?r(t):o(e&&0<e.length)})})},t.prototype.existsSync=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.exec=function(t){var e=this;return new Promise(function(o,r){try{e.db.query(t,function(t,e,n){t?r(t):o()})}catch(t){r(t)}})},t.prototype.execSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementGet=function(t){var e=this;return new Promise(function(o,r){try{e.db.query(t.sql,t.values,function(t,e,n){t?r(t):o(e&&e[0])})}catch(t){r(t)}})},t.prototype.getTableInfo=function(t){return new Promise(function(t,e){})},t.prototype.statementGetSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementGetAll=function(t){var e=this;return new Promise(function(o,r){e.db.query(t.sql,t.values,function(t,e,n){t?r(t):(console.log(n),o(e&&e))})})},t.prototype.statementGetAllSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementRun=function(t){var e=this;return new Promise(function(r,i){e.db.query(t.sql,t.values,function(t,e,n){var o;t?i(t):(o={changes:e.changedRows,affected:e.affectedRows,lastId:e.insertId},r(o))})})},t.prototype.statementRunSync=function(t){throw new Error("Method not implemented.")},t}(smart_db_1.SmartDb);exports.SmartDbMysql=SmartDbMysql;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SmartDb } from "../smart-db";
|
|
2
|
-
import Mysql, { Connection, ConnectionConfig } from "mysql";
|
|
3
|
-
import { SmartDbRunResult, SmartDbSqlBuildData, SmartDbTableInfo } from "../smart-db-interface";
|
|
4
|
-
import { AbstractModel } from "..";
|
|
5
|
-
export declare class SmartDbMysql2 extends SmartDb {
|
|
6
|
-
protected db: Mysql.Connection;
|
|
7
|
-
constructor(connectorOrDb: string | ConnectionConfig | Connection);
|
|
8
|
-
getDatabaseType(): string;
|
|
9
|
-
getDbConnector(): string | Mysql.ConnectionConfig;
|
|
10
|
-
getDbQuote(): string;
|
|
11
|
-
close(): Promise<void>;
|
|
12
|
-
closeSync(): boolean;
|
|
13
|
-
exists<T extends AbstractModel>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): Promise<boolean>;
|
|
14
|
-
existsSync<T extends AbstractModel>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): boolean;
|
|
15
|
-
exec(script: string): Promise<void>;
|
|
16
|
-
execSync(script: string): boolean;
|
|
17
|
-
protected statementGet(buildData: SmartDbSqlBuildData): Promise<any>;
|
|
18
|
-
getTableInfo(table: string): Promise<SmartDbTableInfo>;
|
|
19
|
-
protected statementGetSync(buildData: SmartDbSqlBuildData): any;
|
|
20
|
-
protected statementGetAll(buildData: SmartDbSqlBuildData): Promise<any[]>;
|
|
21
|
-
protected statementGetAllSync(buildData: SmartDbSqlBuildData): any[];
|
|
22
|
-
protected statementRun(buildData: SmartDbSqlBuildData): Promise<SmartDbRunResult>;
|
|
23
|
-
protected statementRunSync(buildData: SmartDbSqlBuildData): SmartDbRunResult;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});var smart_db_1=require("../smart-db"),mysql_1=__importDefault(require("mysql")),_=__importStar(require("lodash")),SmartDbMysql2=function(n){function t(t){var e=this;return t.config&&t.connect?(e=n.call(this,t.config)||this).db=t:(e=n.call(this,t)||this).db=mysql_1.default.createConnection(t),e}return __extends(t,n),t.prototype.getDatabaseType=function(){return"mysql"},t.prototype.getDbConnector=function(){return this.dbConnector},t.prototype.getDbQuote=function(){return"`"},t.prototype.close=function(){var t=this;return new Promise(function(e,n){t.db.end(function(t){t?n(t):e()})})},t.prototype.closeSync=function(){throw new Error("Method not implemented.")},t.prototype.exists=function(e,t,n){var i=this;return new Promise(function(o,r){var t=_.isString(e)?e:e.getTableName();i.db.query("show tables like '"+t+"'",function(t,e,n){t?r(t):o(e&&0<e.length)})})},t.prototype.existsSync=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.exec=function(t){var e=this;return new Promise(function(o,r){try{e.db.query(t,function(t,e,n){t?r(t):o()})}catch(t){r(t)}})},t.prototype.execSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementGet=function(t){var e=this;return new Promise(function(o,r){try{e.db.query(t.sql,t.values,function(t,e,n){t?r(t):o(e&&e[0])})}catch(t){r(t)}})},t.prototype.getTableInfo=function(t){return new Promise(function(t,e){})},t.prototype.statementGetSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementGetAll=function(t){var e=this;return new Promise(function(o,r){e.db.query(t.sql,t.values,function(t,e,n){t?r(t):(console.log(n),o(e&&e))})})},t.prototype.statementGetAllSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementRun=function(t){var e=this;return new Promise(function(r,i){e.db.query(t.sql,t.values,function(t,e,n){var o;t?i(t):(o={changes:e.changedRows,affected:e.affectedRows,lastId:e.insertId},r(o))})})},t.prototype.statementRunSync=function(t){throw new Error("Method not implemented.")},t}(smart_db_1.SmartDb);exports.SmartDbMysql2=SmartDbMysql2;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SmartDb, SmartDbConnector } from "../smart-db";
|
|
2
|
-
import Sqlite3 from "sqlite3";
|
|
3
|
-
import { SmartDbRunResult, SmartDbSqlBuildData, SmartDbTableInfo } from "../smart-db-interface";
|
|
4
|
-
import { AbstractModel } from "..";
|
|
5
|
-
export interface SmartDbSqlit3Options {
|
|
6
|
-
mode?: number;
|
|
7
|
-
callback?: (this: Sqlite3.Database, err: Error | null) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare class SmartDbSqlite3 extends SmartDb {
|
|
10
|
-
protected db: Sqlite3.Database;
|
|
11
|
-
constructor(connectorOrDb: string | Sqlite3.Database, options?: SmartDbSqlit3Options);
|
|
12
|
-
getDatabaseType(): string;
|
|
13
|
-
getDbConnector(): string | SmartDbConnector;
|
|
14
|
-
getDbQuote(): string;
|
|
15
|
-
exists<T extends AbstractModel>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): Promise<boolean>;
|
|
16
|
-
existsSync<T extends AbstractModel>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): boolean;
|
|
17
|
-
exec(script: string): Promise<void>;
|
|
18
|
-
execSync(script: string): Sqlite3.Database | false;
|
|
19
|
-
close(): Promise<void>;
|
|
20
|
-
closeSync(): boolean;
|
|
21
|
-
getTableInfo(table: string): Promise<SmartDbTableInfo>;
|
|
22
|
-
protected statementRun(buildData: SmartDbSqlBuildData): Promise<SmartDbRunResult>;
|
|
23
|
-
protected statementRunSync(buildData: SmartDbSqlBuildData): SmartDbRunResult;
|
|
24
|
-
protected statementGet(buildData: SmartDbSqlBuildData): Promise<any>;
|
|
25
|
-
protected statementGetSync(buildData: SmartDbSqlBuildData): void;
|
|
26
|
-
protected statementGetAll(buildData: SmartDbSqlBuildData): Promise<any[]>;
|
|
27
|
-
protected statementGetAllSync(buildData: SmartDbSqlBuildData): any[];
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});var smart_db_1=require("../smart-db"),sqlite3_1=__importDefault(require("sqlite3")),_=__importStar(require("lodash")),__1=require(".."),SmartDbSqlite3=function(r){function t(t,e){var n=this;return _.isString(t)?(n=r.call(this,t)||this).db=new sqlite3_1.default.Database(t,e&&e.mode,e&&e.callback):(n=r.call(this,null)||this).db=t,n}return __extends(t,r),t.prototype.getDatabaseType=function(){return"sqlite3"},t.prototype.getDbConnector=function(){return this.dbConnector},t.prototype.getDbQuote=function(){return'"'},t.prototype.exists=function(r,o,i){var s=this;return new Promise(function(e,n){try{var t=_.isString(r)?r:r.getTableName();s.getFirst(__1.SqliteMasterModel,{name:t,type:o,tblName:i}).then(function(t){null===t?n(s.getLastError()):e(!!t)}).catch(function(t){n(t)})}catch(t){n(t)}})},t.prototype.existsSync=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.exec=function(t){var r=this;return new Promise(function(e,n){try{r.db.exec(t,function(t){t?n(t):e()})}catch(t){n(t)}})},t.prototype.execSync=function(t){throw new Error("Method not implemented.")},t.prototype.close=function(){var t=this;return new Promise(function(e,n){try{t.smartDbLog.setDb(null),t.db.close(function(t){t?n(t):e()})}catch(t){n(t)}})},t.prototype.closeSync=function(){throw new Error("Method not implemented.")},t.prototype.getTableInfo=function(t){return Promise.resolve(void 0)},t.prototype.statementRun=function(t){var r=this;return new Promise(function(e,n){try{r.db.run(t.sql,t.values,function(t){t?n(t):e({changes:this.changes,affected:this.changes,lastId:this.lastID})})}catch(t){n(t)}})},t.prototype.statementRunSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementGet=function(e){var t=this;return new Promise(function(n,r){try{t.db.prepare(e.sql,function(t){t?r(t):this.get(e.values,function(t,e){t?r(t):n(e)})})}catch(t){r(t)}})},t.prototype.statementGetSync=function(t){throw new Error("Method not implemented.")},t.prototype.statementGetAll=function(e){var t=this;return new Promise(function(n,r){try{t.db.prepare(e.sql,function(t){t?r(t):this.all(e.values,function(t,e){t?r(t):n(e)})})}catch(t){r(t)}})},t.prototype.statementGetAllSync=function(t){throw new Error("Method not implemented.")},t}(smart_db_1.SmartDb);exports.SmartDbSqlite3=SmartDbSqlite3;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),n=0,t=0;t<r;t++)for(var s=arguments[t],l=0,o=s.length;l<o;l++,n++)a[n]=s[l];return a},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var smart_db_interface_1=require("../smart-db-interface"),smart_db_core_table_model_1=require("../model/smart-db-core-table-model"),smart_db_better_sqlite3_1=require("../drivers/smart-db-better-sqlite3"),process_1=__importDefault(require("process")),lodash_1=__importDefault(require("lodash")),fs_1=__importDefault(require("fs"));function getType(e){var t=e?e.match(/varchar/i)||e.match(/text/i)?"string":e.match(/integer\(1\)/i)?"boolean":e.match(/date/i)?"Date":e.match(/integer/i)||e.match(/number/i)?"number":e||"SqlValueType":"SqlValueType";return t}function extractDbInterface(_){console.log("extract interface from '"+_.db.getDbConnector()+"' to '"+_.modelDirectory+"'"),fs_1.default.existsSync(_.modelDirectory)||fs_1.default.mkdirSync(_.modelDirectory,{recursive:!0});var e=_.db.getAllSync("sqlite_master",{type:smart_db_interface_1.IN(["table","view"]),name:smart_db_interface_1.NE("sqlite_sequence")});if(!1===e)console.error(_.db.getLastError()),process_1.default.abort();else{var t=[];if(!_.includeCoreTables&&_.db.existsSync(smart_db_core_table_model_1.SmartDbCoreTableModel)){var r=_.db.getAllSync(smart_db_core_table_model_1.SmartDbCoreTableModel);if(!1===r)throw _.db.getLastError();r.forEach(function(e){t.push(e.name)})}var a=[];e.forEach(function(m){var b,f;t.includes(m.name)||(b=m.name[0].toUpperCase()+lodash_1.default.camelCase(m.name.substr(1))+"Model",a.push(b),f=[],_.db.getTableInfo(m.name).then(function(e){var r,a,s,n,l,o,t,i=e.fields,c=!1,d="",u="/* eslint-disable @typescript-eslint/member-ordering */\n";i?(u+='import {AbstractModel, GenericModel, ModelAttributeMap} from "'+_.abstractModelModule+'";\n',d+="export interface "+b+"Data extends Record<string, any> {\n","user"==m.name&&i.push({name:"hash",type:"string",virtual:!0},{name:"privileges",type:"string[]",virtual:!0}),a=r="",n=!1,l=[],i.forEach(function(e){var t=e.name.match(/([a-z0-9]{1,4})_/i);e.pk&&(r=e.name,t&&(a=t[1])),t?l.includes(t[1])||l.push(t[1]):n=!0}),a||n||1!=l.length||(a=l[0]),a&&(s=new RegExp("^"+a+"_(.*)$")),o={},i.forEach(function(e){var t=getType(e.type);"SqlValueType"!=t||c||(u+='import {SqlValueType} from "'+_.smartDbInterface+'";\n',c=!0);var r,a=s&&e.name.match(s),n=!0;(r=a?lodash_1.default.camelCase(a[1]):lodash_1.default.camelCase(e.name))!=e.name&&(f.push({name:r,attribute:r,type:t,typeScriptStyle:n,alias:e.name}),n=!1),f.push({name:e.name,attribute:r,type:t,physical:void 0!==e.cid,typeScriptStyle:n}),o[r]=t,d+=" "+r+"?: "+t+";\n"}),d+="}\n\n",d+="export class "+b+" extends AbstractModel {\n",lodash_1.default.forEach(o,function(e,t){d+=" private _"+t+"?: "+e+";\n"}),d+="\n",d+=" static readonly attributeMap: ModelAttributeMap = {\n",f.forEach(function(e,t){0<t&&(d+=",\n"),d+=" "+e.name+": {\n",e.physical&&(d+=" physical: true,\n"),e.alias&&(d+=' alias: "'+e.alias+'",\n'),e.virtual&&(d+=" virtual: true,\n"),e.typeScriptStyle&&(d+=" typeScriptStyle: true,\n"),d+=' type: "'+e.type+'",\n',d+=' attribute: "_'+e.attribute+'"\n',d+=" }"}),d+="\n",d+=" };\n",d+="\n",d+=" static getClassName(): string {\n",d+=' return "'+b+'";\n',d+=" }\n",d+="\n",d+=" static getTableName(): string {\n",d+=' return "'+m.name+'";\n',d+=" }\n",d+="\n",d+=" static getPrimaryKey(): string {\n",d+=' return "'+r+'";\n',d+=" }\n",d+="\n",d+=" static from(other: AbstractModel | GenericModel): "+b+" {\n",d+=" let value: "+b+" = null;\n",d+=" if (other) {\n",d+=" value = new "+b+"();\n",d+=' if (other.getClassName && (<AbstractModel>other).getClassName() == "'+b+'") {\n',d+=" Object.assign(value, other);\n",d+=" } else {\n",d+=" value.assign(other as GenericModel);\n",d+=" }\n",d+=" }\n",d+=" return value;\n",d+=" }\n",d+="\n",d+=" public clone(): AbstractModel {\n",d+=" return "+b+".from(this);\n",d+=" }\n",d+="\n",d+=" public getClassName(): string {\n",d+=' return "'+b+'";\n',d+=" }\n",d+="\n",d+=" public getTableName(): string {\n",d+=' return "'+m.name+'";\n',d+=" }\n",d+="\n",d+=" public getPrimaryKey(): string {\n",d+=' return "'+r+'";\n',d+=" }\n",d+="\n",d+=" public getAttributeMap(): ModelAttributeMap {\n",d+=" return "+b+".attributeMap;\n",d+=" }\n",f.forEach(function(e){var t;d+="\n",""!==(t=e.name.length<3||e.name.match(/_/)?"FunctionNamingConventionJS":"")&&(d+=" // noinspection "+t+"\n"),d+=" get "+e.name+"(): "+e.type+" {\n",d+=" return this._"+e.attribute+";\n",d+=" }\n\n",""!==t&&(d+=" // noinspection "+t+"\n"),d+=" set "+e.name+"("+e.attribute+": "+e.type+") {\n",d+=" this._"+e.attribute+" = "+e.attribute+";\n",d+=" }\n"}),d=u+"\n"+(d+="}\n"),t=m.name.replace(/[^[a-z0-9]/g,"-")+"-model.ts",fs_1.default.writeFileSync(_.modelDirectory+"/"+t,d)):console.log("error: table has no fields")}).catch(function(e){console.error(e),process_1.default.abort()}))});var n='import {AbstractModel} from "'+_.abstractModelModule+'";\n';lodash_1.default.forEach(a,function(e){n+="import {"+e+'} from "./'+lodash_1.default.kebabCase(e)+'";\n'}),n+="\n",n+="interface SmartDbDictionaryEntry {\n",n+=" cls: "+a.map(function(e){return"typeof "+e}).join(" |\n "),n+=";\n",n+="}\n\n",n+="export class SmartDbDictionary {\n",n+=" static models: { [relation: string]: SmartDbDictionaryEntry; } = {\n",lodash_1.default.forEach(a,function(e){n+=" "+e+": {\n",n+=" cls: "+e+"\n",n+=" },\n"}),n=n.substring(0,n.length-2)+"\n",n+=" };\n\n",n+=" static createModel(relationName: string): AbstractModel {\n",n+=" const entry = SmartDbDictionary.models[relationName];\n",n+=" return entry && entry.cls && new (entry.cls)();\n",n+=" }\n",n+="}\n",fs_1.default.writeFileSync(_.modelDirectory+"/smart-db-dictionary.ts",n)}_.db.closeSync()}!function(){var t,r,a;4==process_1.default.argv.length?extractDbInterface({modelDirectory:process_1.default.argv[3],smartDbInterface:"smart-db",abstractModelModule:"smart-db",db:new smart_db_better_sqlite3_1.SmartDbBetterSqlite3(process_1.default.argv[2],{verbose:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.log.apply(console,__spreadArrays(["DB LOG",e],t))}})}):2==process_1.default.argv.length&&fs_1.default.existsSync("src/helpers/extract-db-interface.ts")?(t="/tmp/smart-db-core."+process_1.default.pid+".sqlite3",(r={includeCoreTables:!0,modelDirectory:"src/model",smartDbInterface:"../smart-db-interface",abstractModelModule:"./abstract-model",db:new smart_db_better_sqlite3_1.SmartDbBetterSqlite3(t,{verbose:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.log.apply(console,__spreadArrays(["DB LOG",e],t))}})}).db.initDb({module:"smart-db-core",sqlFilesDirectory:"assets/sqlite3"}).then(function(e){extractDbInterface(r),fs_1.default.unlinkSync(t),r.db.closeSync()}),fs_1.default.existsSync("test/test.sqlite3")&&fs_1.default.unlinkSync("test/test.sqlite3"),(a={modelDirectory:"test/model",smartDbInterface:"../../src/smart-db-interface",abstractModelModule:"../../src/model/abstract-model",db:new smart_db_better_sqlite3_1.SmartDbBetterSqlite3("test/db/sqlite3.db",{verbose:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.log.apply(console,__spreadArrays(["DB LOG",e],t))}})}).db.initDb({module:"smart-db-test",sqlFilesDirectory:"test/db/sqlite3"}).then(function(e){extractDbInterface(a)})):console.log("usage: extract-db-interface {db-connector|path-to-db} {target-model-directory}")}();
|
package/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "./smart-db";
|
|
2
|
-
export * from "./smart-db-log";
|
|
3
|
-
export * from "./smart-db-interface";
|
|
4
|
-
export * from "./smart-db-upgrade-manager";
|
|
5
|
-
export * from "./model/abstract-model";
|
|
6
|
-
export * from "./model/smart-db-version-model";
|
|
7
|
-
export * from "./model/smart-db-version-view-model";
|
|
8
|
-
export * from "./model/smart-db-log-model";
|
|
9
|
-
export * from "./model/sqlite-master-model";
|
|
10
|
-
export * from "./model/sqlite-sequence-model";
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function __export(e){for(var r in e)exports.hasOwnProperty(r)||(exports[r]=e[r])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(require("./smart-db")),__export(require("./smart-db-log")),__export(require("./smart-db-interface")),__export(require("./smart-db-upgrade-manager")),__export(require("./model/abstract-model")),__export(require("./model/smart-db-version-model")),__export(require("./model/smart-db-version-view-model")),__export(require("./model/smart-db-log-model")),__export(require("./model/sqlite-master-model")),__export(require("./model/sqlite-sequence-model"));
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SqlValueType } from "../smart-db-interface";
|
|
2
|
-
export declare type GenericModel = Record<string, SqlValueType>;
|
|
3
|
-
export interface AttributeInfo {
|
|
4
|
-
attribute: string;
|
|
5
|
-
type: string;
|
|
6
|
-
alias?: string;
|
|
7
|
-
physical?: boolean;
|
|
8
|
-
virtual?: boolean;
|
|
9
|
-
alternative?: boolean;
|
|
10
|
-
typeScriptStyle?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ModelAttributeMap {
|
|
13
|
-
[key: string]: AttributeInfo;
|
|
14
|
-
}
|
|
15
|
-
export interface AbstractModelGlobals {
|
|
16
|
-
attributeMap: ModelAttributeMap;
|
|
17
|
-
getTableName: () => string;
|
|
18
|
-
from: (other: GenericModel | AbstractModel) => AbstractModel;
|
|
19
|
-
}
|
|
20
|
-
export declare enum FieldNamingStyle {
|
|
21
|
-
Database = 0,
|
|
22
|
-
TypeScript = 1,
|
|
23
|
-
All = 2
|
|
24
|
-
}
|
|
25
|
-
export declare abstract class AbstractModel {
|
|
26
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
27
|
-
static getTableName(): string;
|
|
28
|
-
static from(other: GenericModel | AbstractModel): any;
|
|
29
|
-
abstract clone(): AbstractModel;
|
|
30
|
-
abstract getClassName(): string;
|
|
31
|
-
abstract getTableName(): string;
|
|
32
|
-
abstract getPrimaryKey(): string;
|
|
33
|
-
abstract getAttributeMap(): ModelAttributeMap;
|
|
34
|
-
assign(other: GenericModel, options?: {
|
|
35
|
-
only?: string[];
|
|
36
|
-
exclude?: string[];
|
|
37
|
-
}): void;
|
|
38
|
-
setValue(attribute: string, value: string | number | boolean | Date): void;
|
|
39
|
-
getValue(attribute: string): string | number | boolean;
|
|
40
|
-
hasAttribute(attribute: string): boolean;
|
|
41
|
-
clear(attributes: string | string[]): void;
|
|
42
|
-
getPlainObject(style: FieldNamingStyle, includeVirtuals?: boolean, fields?: string[]): GenericModel;
|
|
43
|
-
private toDbTimestamp;
|
|
44
|
-
}
|
package/model/abstract-model.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});var FieldNamingStyle,_=__importStar(require("lodash"));!function(t){t[t.Database=0]="Database",t[t.TypeScript=1]="TypeScript",t[t.All=2]="All"}(FieldNamingStyle=exports.FieldNamingStyle||(exports.FieldNamingStyle={}));var AbstractModel=function(){function s(){}return s.getTableName=function(){return"overload this in child class"},s.from=function(t){return t},s.prototype.assign=function(r,a){var t,n=this;"object"==typeof r&&(t=this.getAttributeMap(),Object.keys(t).forEach(function(t){var e,i=!0;a&&(a.only&&!_.includes(a.only,t)&&(i=!1),a.exclude&&_.includes(a.exclude,t)&&(i=!1)),i&&(r instanceof s&&r.hasAttribute(t)?n.setValue(t,r.getValue(t)):r.hasOwnProperty(t)&&(e=r[t],n.setValue(t,e)))}))},s.prototype.setValue=function(t,e){var i=this.getAttributeMap()[t];if(!i)throw"unknown attribute "+t+" for "+this.getClassName();if(null===e)this[i.attribute]=null;else if(void 0===e)delete this[i.attribute];else{switch(i.type){case"SqlValueType":break;case"string":_.isNumber(e)?e=e.toString():_.isBoolean(e)?e=e?"true":"false":_.isDate(e)&&(e=this.toDbTimestamp(e));break;case"number":_.isString(e)?e=parseFloat(e):_.isBoolean(e)?e=e?1:0:_.isDate(e)&&(e=e.getTime());break;case"boolean":_.isString(e)?e=!e.match(/(F|N|false|no|0)/i):_.isNumber(e)?e=!!e:_.isDate(e)&&(e=!0);break;case"Date":_.isString(e)&&e.match(/^\d{4}-[01][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-5][0-9]\s*$/)&&(e+=" GMT"),e=_.isNumber(e)||_.isString(e)||_.isDate(e)?new Date(e):new Date;break;default:throw"AbstractModel.setValue: unknown data type '"+i.type+"'"}this[i.attribute]=e}},s.prototype.getValue=function(t){var e=this.getAttributeMap()[t];return this[e.attribute]},s.prototype.hasAttribute=function(t){return!!this.getAttributeMap()[t]},s.prototype.clear=function(t){var i=this;_.isArray(t)||(t=[t]);var r=this.getAttributeMap();t.forEach(function(t){var e=r[t];e&&delete i[e.attribute]})},s.prototype.getPlainObject=function(r,a,n){var s=this,o=this.getAttributeMap(),l=[];void 0===a&&(a=!0),_.forOwn(o,function(t,e){var i=r==FieldNamingStyle.All||a&&t.virtual;if(!i)if(r==FieldNamingStyle.Database)i=t.physical;else{if(r!=FieldNamingStyle.TypeScript)throw"unknown style "+r;i=t.typeScriptStyle}i&&(n&&!_.includes(n,e)||l.push(e))});var u={};return l.forEach(function(t){var e,i=o[t];!i||void 0!==(e=s[i.attribute])&&(u[t]=e)}),u},s.prototype.toDbTimestamp=function(t){var e;return t&&(_.isNumber(t)&&(t=new Date(t)),e=t.toISOString().substr(0,23).replace("T"," ")),e},s.attributeMap={},s}();exports.AbstractModel=AbstractModel;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AbstractModel, GenericModel, ModelAttributeMap } from "./abstract-model";
|
|
2
|
-
export interface SmartDbCoreTableModelData extends Record<string, any> {
|
|
3
|
-
id?: number;
|
|
4
|
-
name?: string;
|
|
5
|
-
type?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class SmartDbCoreTableModel extends AbstractModel {
|
|
8
|
-
private _id?;
|
|
9
|
-
private _name?;
|
|
10
|
-
private _type?;
|
|
11
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
12
|
-
static getClassName(): string;
|
|
13
|
-
static getTableName(): string;
|
|
14
|
-
static getPrimaryKey(): string;
|
|
15
|
-
static from(other: AbstractModel | GenericModel): SmartDbCoreTableModel;
|
|
16
|
-
clone(): AbstractModel;
|
|
17
|
-
getClassName(): string;
|
|
18
|
-
getTableName(): string;
|
|
19
|
-
getPrimaryKey(): string;
|
|
20
|
-
getAttributeMap(): ModelAttributeMap;
|
|
21
|
-
get id(): number;
|
|
22
|
-
set id(id: number);
|
|
23
|
-
get ctb_id(): number;
|
|
24
|
-
set ctb_id(id: number);
|
|
25
|
-
get name(): string;
|
|
26
|
-
set name(name: string);
|
|
27
|
-
get ctb_name(): string;
|
|
28
|
-
set ctb_name(name: string);
|
|
29
|
-
get type(): string;
|
|
30
|
-
set type(type: string);
|
|
31
|
-
get ctb_type(): string;
|
|
32
|
-
set ctb_type(type: string);
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};return function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var abstract_model_1=require("./abstract-model"),SmartDbCoreTableModel=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return __extends(r,t),r.getClassName=function(){return"SmartDbCoreTableModel"},r.getTableName=function(){return"smart_db_core_table"},r.getPrimaryKey=function(){return"ctb_id"},r.from=function(t){var e=null;return t&&(e=new r,t.getClassName&&"SmartDbCoreTableModel"==t.getClassName()?Object.assign(e,t):e.assign(t)),e},r.prototype.clone=function(){return r.from(this)},r.prototype.getClassName=function(){return"SmartDbCoreTableModel"},r.prototype.getTableName=function(){return"smart_db_core_table"},r.prototype.getPrimaryKey=function(){return"ctb_id"},r.prototype.getAttributeMap=function(){return r.attributeMap},Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ctb_id",{get:function(){return this._id},set:function(t){this._id=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ctb_name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ctb_type",{get:function(){return this._type},set:function(t){this._type=t},enumerable:!0,configurable:!0}),r.attributeMap={id:{alias:"ctb_id",typeScriptStyle:!0,type:"number",attribute:"_id"},ctb_id:{physical:!0,type:"number",attribute:"_id"},name:{alias:"ctb_name",typeScriptStyle:!0,type:"string",attribute:"_name"},ctb_name:{physical:!0,type:"string",attribute:"_name"},type:{alias:"ctb_type",typeScriptStyle:!0,type:"string",attribute:"_type"},ctb_type:{physical:!0,type:"string",attribute:"_type"}},r}(abstract_model_1.AbstractModel);exports.SmartDbCoreTableModel=SmartDbCoreTableModel;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AbstractModel } from "./abstract-model";
|
|
2
|
-
import { SmartDbCoreTableModel } from "./smart-db-core-table-model";
|
|
3
|
-
import { SmartDbLogModel } from "./smart-db-log-model";
|
|
4
|
-
import { SmartDbVersionModel } from "./smart-db-version-model";
|
|
5
|
-
import { SmartDbVersionViewModel } from "./smart-db-version-view-model";
|
|
6
|
-
interface SmartDbDictionaryEntry {
|
|
7
|
-
cls: typeof SmartDbCoreTableModel | typeof SmartDbLogModel | typeof SmartDbVersionModel | typeof SmartDbVersionViewModel;
|
|
8
|
-
}
|
|
9
|
-
export declare class SmartDbDictionary {
|
|
10
|
-
static models: {
|
|
11
|
-
[relation: string]: SmartDbDictionaryEntry;
|
|
12
|
-
};
|
|
13
|
-
static createModel(relationName: string): AbstractModel;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var smart_db_core_table_model_1=require("./smart-db-core-table-model"),smart_db_log_model_1=require("./smart-db-log-model"),smart_db_version_model_1=require("./smart-db-version-model"),smart_db_version_view_model_1=require("./smart-db-version-view-model"),SmartDbDictionary=function(){function o(){}return o.createModel=function(e){var r=o.models[e];return r&&r.cls&&new r.cls},o.models={SmartDbCoreTableModel:{cls:smart_db_core_table_model_1.SmartDbCoreTableModel},SmartDbLogModel:{cls:smart_db_log_model_1.SmartDbLogModel},SmartDbVersionModel:{cls:smart_db_version_model_1.SmartDbVersionModel},SmartDbVersionViewModel:{cls:smart_db_version_view_model_1.SmartDbVersionViewModel}},o}();exports.SmartDbDictionary=SmartDbDictionary;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { AbstractModel, GenericModel, ModelAttributeMap } from "./abstract-model";
|
|
2
|
-
export interface SmartDbLogModelData extends Record<string, any> {
|
|
3
|
-
id?: number;
|
|
4
|
-
severity?: string;
|
|
5
|
-
type?: string;
|
|
6
|
-
location?: string;
|
|
7
|
-
info?: string;
|
|
8
|
-
data?: string;
|
|
9
|
-
user?: string;
|
|
10
|
-
timestamp?: Date;
|
|
11
|
-
}
|
|
12
|
-
export declare class SmartDbLogModel extends AbstractModel {
|
|
13
|
-
private _id?;
|
|
14
|
-
private _severity?;
|
|
15
|
-
private _type?;
|
|
16
|
-
private _location?;
|
|
17
|
-
private _info?;
|
|
18
|
-
private _data?;
|
|
19
|
-
private _user?;
|
|
20
|
-
private _timestamp?;
|
|
21
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
22
|
-
static getClassName(): string;
|
|
23
|
-
static getTableName(): string;
|
|
24
|
-
static getPrimaryKey(): string;
|
|
25
|
-
static from(other: AbstractModel | GenericModel): SmartDbLogModel;
|
|
26
|
-
clone(): AbstractModel;
|
|
27
|
-
getClassName(): string;
|
|
28
|
-
getTableName(): string;
|
|
29
|
-
getPrimaryKey(): string;
|
|
30
|
-
getAttributeMap(): ModelAttributeMap;
|
|
31
|
-
get id(): number;
|
|
32
|
-
set id(id: number);
|
|
33
|
-
get log_id(): number;
|
|
34
|
-
set log_id(id: number);
|
|
35
|
-
get severity(): string;
|
|
36
|
-
set severity(severity: string);
|
|
37
|
-
get log_severity(): string;
|
|
38
|
-
set log_severity(severity: string);
|
|
39
|
-
get type(): string;
|
|
40
|
-
set type(type: string);
|
|
41
|
-
get log_type(): string;
|
|
42
|
-
set log_type(type: string);
|
|
43
|
-
get location(): string;
|
|
44
|
-
set location(location: string);
|
|
45
|
-
get log_location(): string;
|
|
46
|
-
set log_location(location: string);
|
|
47
|
-
get info(): string;
|
|
48
|
-
set info(info: string);
|
|
49
|
-
get log_info(): string;
|
|
50
|
-
set log_info(info: string);
|
|
51
|
-
get data(): string;
|
|
52
|
-
set data(data: string);
|
|
53
|
-
get log_data(): string;
|
|
54
|
-
set log_data(data: string);
|
|
55
|
-
get user(): string;
|
|
56
|
-
set user(user: string);
|
|
57
|
-
get log_user(): string;
|
|
58
|
-
set log_user(user: string);
|
|
59
|
-
get timestamp(): Date;
|
|
60
|
-
set timestamp(timestamp: Date);
|
|
61
|
-
get log_timestamp(): Date;
|
|
62
|
-
set log_timestamp(timestamp: Date);
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};return function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var abstract_model_1=require("./abstract-model"),SmartDbLogModel=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return __extends(r,t),r.getClassName=function(){return"SmartDbLogModel"},r.getTableName=function(){return"smart_db_log"},r.getPrimaryKey=function(){return"log_id"},r.from=function(t){var e=null;return t&&(e=new r,t.getClassName&&"SmartDbLogModel"==t.getClassName()?Object.assign(e,t):e.assign(t)),e},r.prototype.clone=function(){return r.from(this)},r.prototype.getClassName=function(){return"SmartDbLogModel"},r.prototype.getTableName=function(){return"smart_db_log"},r.prototype.getPrimaryKey=function(){return"log_id"},r.prototype.getAttributeMap=function(){return r.attributeMap},Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_id",{get:function(){return this._id},set:function(t){this._id=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"severity",{get:function(){return this._severity},set:function(t){this._severity=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_severity",{get:function(){return this._severity},set:function(t){this._severity=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_type",{get:function(){return this._type},set:function(t){this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"location",{get:function(){return this._location},set:function(t){this._location=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_location",{get:function(){return this._location},set:function(t){this._location=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"info",{get:function(){return this._info},set:function(t){this._info=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_info",{get:function(){return this._info},set:function(t){this._info=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"user",{get:function(){return this._user},set:function(t){this._user=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_user",{get:function(){return this._user},set:function(t){this._user=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"timestamp",{get:function(){return this._timestamp},set:function(t){this._timestamp=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"log_timestamp",{get:function(){return this._timestamp},set:function(t){this._timestamp=t},enumerable:!0,configurable:!0}),r.attributeMap={id:{alias:"log_id",typeScriptStyle:!0,type:"number",attribute:"_id"},log_id:{physical:!0,type:"number",attribute:"_id"},severity:{alias:"log_severity",typeScriptStyle:!0,type:"string",attribute:"_severity"},log_severity:{physical:!0,type:"string",attribute:"_severity"},type:{alias:"log_type",typeScriptStyle:!0,type:"string",attribute:"_type"},log_type:{physical:!0,type:"string",attribute:"_type"},location:{alias:"log_location",typeScriptStyle:!0,type:"string",attribute:"_location"},log_location:{physical:!0,type:"string",attribute:"_location"},info:{alias:"log_info",typeScriptStyle:!0,type:"string",attribute:"_info"},log_info:{physical:!0,type:"string",attribute:"_info"},data:{alias:"log_data",typeScriptStyle:!0,type:"string",attribute:"_data"},log_data:{physical:!0,type:"string",attribute:"_data"},user:{alias:"log_user",typeScriptStyle:!0,type:"string",attribute:"_user"},log_user:{physical:!0,type:"string",attribute:"_user"},timestamp:{alias:"log_timestamp",typeScriptStyle:!0,type:"Date",attribute:"_timestamp"},log_timestamp:{physical:!0,type:"Date",attribute:"_timestamp"}},r}(abstract_model_1.AbstractModel);exports.SmartDbLogModel=SmartDbLogModel;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { AbstractModel, GenericModel, ModelAttributeMap } from "./abstract-model";
|
|
2
|
-
export interface SmartDbVersionModelData extends Record<string, any> {
|
|
3
|
-
id?: number;
|
|
4
|
-
module?: string;
|
|
5
|
-
sequence?: number;
|
|
6
|
-
version?: string;
|
|
7
|
-
subVersion?: string;
|
|
8
|
-
revision?: string;
|
|
9
|
-
releaseType?: string;
|
|
10
|
-
installDate?: Date;
|
|
11
|
-
}
|
|
12
|
-
export declare class SmartDbVersionModel extends AbstractModel {
|
|
13
|
-
private _id?;
|
|
14
|
-
private _module?;
|
|
15
|
-
private _sequence?;
|
|
16
|
-
private _version?;
|
|
17
|
-
private _subVersion?;
|
|
18
|
-
private _revision?;
|
|
19
|
-
private _releaseType?;
|
|
20
|
-
private _installDate?;
|
|
21
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
22
|
-
static getClassName(): string;
|
|
23
|
-
static getTableName(): string;
|
|
24
|
-
static getPrimaryKey(): string;
|
|
25
|
-
static from(other: AbstractModel | GenericModel): SmartDbVersionModel;
|
|
26
|
-
clone(): AbstractModel;
|
|
27
|
-
getClassName(): string;
|
|
28
|
-
getTableName(): string;
|
|
29
|
-
getPrimaryKey(): string;
|
|
30
|
-
getAttributeMap(): ModelAttributeMap;
|
|
31
|
-
get id(): number;
|
|
32
|
-
set id(id: number);
|
|
33
|
-
get ver_id(): number;
|
|
34
|
-
set ver_id(id: number);
|
|
35
|
-
get module(): string;
|
|
36
|
-
set module(module: string);
|
|
37
|
-
get ver_module(): string;
|
|
38
|
-
set ver_module(module: string);
|
|
39
|
-
get sequence(): number;
|
|
40
|
-
set sequence(sequence: number);
|
|
41
|
-
get ver_sequence(): number;
|
|
42
|
-
set ver_sequence(sequence: number);
|
|
43
|
-
get version(): string;
|
|
44
|
-
set version(version: string);
|
|
45
|
-
get ver_version(): string;
|
|
46
|
-
set ver_version(version: string);
|
|
47
|
-
get subVersion(): string;
|
|
48
|
-
set subVersion(subVersion: string);
|
|
49
|
-
get ver_sub_version(): string;
|
|
50
|
-
set ver_sub_version(subVersion: string);
|
|
51
|
-
get revision(): string;
|
|
52
|
-
set revision(revision: string);
|
|
53
|
-
get ver_revision(): string;
|
|
54
|
-
set ver_revision(revision: string);
|
|
55
|
-
get releaseType(): string;
|
|
56
|
-
set releaseType(releaseType: string);
|
|
57
|
-
get ver_release_type(): string;
|
|
58
|
-
set ver_release_type(releaseType: string);
|
|
59
|
-
get installDate(): Date;
|
|
60
|
-
set installDate(installDate: Date);
|
|
61
|
-
get ver_install_date(): Date;
|
|
62
|
-
set ver_install_date(installDate: Date);
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};return function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var abstract_model_1=require("./abstract-model"),SmartDbVersionModel=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return __extends(r,e),r.getClassName=function(){return"SmartDbVersionModel"},r.getTableName=function(){return"smart_db_version"},r.getPrimaryKey=function(){return"ver_id"},r.from=function(e){var t=null;return e&&(t=new r,e.getClassName&&"SmartDbVersionModel"==e.getClassName()?Object.assign(t,e):t.assign(e)),t},r.prototype.clone=function(){return r.from(this)},r.prototype.getClassName=function(){return"SmartDbVersionModel"},r.prototype.getTableName=function(){return"smart_db_version"},r.prototype.getPrimaryKey=function(){return"ver_id"},r.prototype.getAttributeMap=function(){return r.attributeMap},Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_id",{get:function(){return this._id},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"module",{get:function(){return this._module},set:function(e){this._module=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_module",{get:function(){return this._module},set:function(e){this._module=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"sequence",{get:function(){return this._sequence},set:function(e){this._sequence=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_sequence",{get:function(){return this._sequence},set:function(e){this._sequence=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},set:function(e){this._version=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_version",{get:function(){return this._version},set:function(e){this._version=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"subVersion",{get:function(){return this._subVersion},set:function(e){this._subVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_sub_version",{get:function(){return this._subVersion},set:function(e){this._subVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"revision",{get:function(){return this._revision},set:function(e){this._revision=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_revision",{get:function(){return this._revision},set:function(e){this._revision=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"releaseType",{get:function(){return this._releaseType},set:function(e){this._releaseType=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_release_type",{get:function(){return this._releaseType},set:function(e){this._releaseType=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"installDate",{get:function(){return this._installDate},set:function(e){this._installDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_install_date",{get:function(){return this._installDate},set:function(e){this._installDate=e},enumerable:!0,configurable:!0}),r.attributeMap={id:{alias:"ver_id",typeScriptStyle:!0,type:"number",attribute:"_id"},ver_id:{physical:!0,type:"number",attribute:"_id"},module:{alias:"ver_module",typeScriptStyle:!0,type:"string",attribute:"_module"},ver_module:{physical:!0,type:"string",attribute:"_module"},sequence:{alias:"ver_sequence",typeScriptStyle:!0,type:"number",attribute:"_sequence"},ver_sequence:{physical:!0,type:"number",attribute:"_sequence"},version:{alias:"ver_version",typeScriptStyle:!0,type:"string",attribute:"_version"},ver_version:{physical:!0,type:"string",attribute:"_version"},subVersion:{alias:"ver_sub_version",typeScriptStyle:!0,type:"string",attribute:"_subVersion"},ver_sub_version:{physical:!0,type:"string",attribute:"_subVersion"},revision:{alias:"ver_revision",typeScriptStyle:!0,type:"string",attribute:"_revision"},ver_revision:{physical:!0,type:"string",attribute:"_revision"},releaseType:{alias:"ver_release_type",typeScriptStyle:!0,type:"string",attribute:"_releaseType"},ver_release_type:{physical:!0,type:"string",attribute:"_releaseType"},installDate:{alias:"ver_install_date",typeScriptStyle:!0,type:"Date",attribute:"_installDate"},ver_install_date:{physical:!0,type:"Date",attribute:"_installDate"}},r}(abstract_model_1.AbstractModel);exports.SmartDbVersionModel=SmartDbVersionModel;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { AbstractModel, GenericModel, ModelAttributeMap } from "./abstract-model";
|
|
2
|
-
import { SqlValueType } from "../smart-db-interface";
|
|
3
|
-
export interface SmartDbVersionViewModelData extends Record<string, any> {
|
|
4
|
-
id?: number;
|
|
5
|
-
module?: string;
|
|
6
|
-
sequence?: number;
|
|
7
|
-
version?: string;
|
|
8
|
-
subVersion?: string;
|
|
9
|
-
revision?: string;
|
|
10
|
-
releaseType?: string;
|
|
11
|
-
installDate?: Date;
|
|
12
|
-
versionString?: SqlValueType;
|
|
13
|
-
}
|
|
14
|
-
export declare class SmartDbVersionViewModel extends AbstractModel {
|
|
15
|
-
private _id?;
|
|
16
|
-
private _module?;
|
|
17
|
-
private _sequence?;
|
|
18
|
-
private _version?;
|
|
19
|
-
private _subVersion?;
|
|
20
|
-
private _revision?;
|
|
21
|
-
private _releaseType?;
|
|
22
|
-
private _installDate?;
|
|
23
|
-
private _versionString?;
|
|
24
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
25
|
-
static getClassName(): string;
|
|
26
|
-
static getTableName(): string;
|
|
27
|
-
static getPrimaryKey(): string;
|
|
28
|
-
static from(other: AbstractModel | GenericModel): SmartDbVersionViewModel;
|
|
29
|
-
clone(): AbstractModel;
|
|
30
|
-
getClassName(): string;
|
|
31
|
-
getTableName(): string;
|
|
32
|
-
getPrimaryKey(): string;
|
|
33
|
-
getAttributeMap(): ModelAttributeMap;
|
|
34
|
-
get id(): number;
|
|
35
|
-
set id(id: number);
|
|
36
|
-
get ver_id(): number;
|
|
37
|
-
set ver_id(id: number);
|
|
38
|
-
get module(): string;
|
|
39
|
-
set module(module: string);
|
|
40
|
-
get ver_module(): string;
|
|
41
|
-
set ver_module(module: string);
|
|
42
|
-
get sequence(): number;
|
|
43
|
-
set sequence(sequence: number);
|
|
44
|
-
get ver_sequence(): number;
|
|
45
|
-
set ver_sequence(sequence: number);
|
|
46
|
-
get version(): string;
|
|
47
|
-
set version(version: string);
|
|
48
|
-
get ver_version(): string;
|
|
49
|
-
set ver_version(version: string);
|
|
50
|
-
get subVersion(): string;
|
|
51
|
-
set subVersion(subVersion: string);
|
|
52
|
-
get ver_sub_version(): string;
|
|
53
|
-
set ver_sub_version(subVersion: string);
|
|
54
|
-
get revision(): string;
|
|
55
|
-
set revision(revision: string);
|
|
56
|
-
get ver_revision(): string;
|
|
57
|
-
set ver_revision(revision: string);
|
|
58
|
-
get releaseType(): string;
|
|
59
|
-
set releaseType(releaseType: string);
|
|
60
|
-
get ver_release_type(): string;
|
|
61
|
-
set ver_release_type(releaseType: string);
|
|
62
|
-
get installDate(): Date;
|
|
63
|
-
set installDate(installDate: Date);
|
|
64
|
-
get ver_install_date(): Date;
|
|
65
|
-
set ver_install_date(installDate: Date);
|
|
66
|
-
get versionString(): SqlValueType;
|
|
67
|
-
set versionString(versionString: SqlValueType);
|
|
68
|
-
get ver_version_string(): SqlValueType;
|
|
69
|
-
set ver_version_string(versionString: SqlValueType);
|
|
70
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};return function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var abstract_model_1=require("./abstract-model"),SmartDbVersionViewModel=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return __extends(r,e),r.getClassName=function(){return"SmartDbVersionViewModel"},r.getTableName=function(){return"smart_db_version_view"},r.getPrimaryKey=function(){return""},r.from=function(e){var t=null;return e&&(t=new r,e.getClassName&&"SmartDbVersionViewModel"==e.getClassName()?Object.assign(t,e):t.assign(e)),t},r.prototype.clone=function(){return r.from(this)},r.prototype.getClassName=function(){return"SmartDbVersionViewModel"},r.prototype.getTableName=function(){return"smart_db_version_view"},r.prototype.getPrimaryKey=function(){return""},r.prototype.getAttributeMap=function(){return r.attributeMap},Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_id",{get:function(){return this._id},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"module",{get:function(){return this._module},set:function(e){this._module=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_module",{get:function(){return this._module},set:function(e){this._module=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"sequence",{get:function(){return this._sequence},set:function(e){this._sequence=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_sequence",{get:function(){return this._sequence},set:function(e){this._sequence=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},set:function(e){this._version=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_version",{get:function(){return this._version},set:function(e){this._version=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"subVersion",{get:function(){return this._subVersion},set:function(e){this._subVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_sub_version",{get:function(){return this._subVersion},set:function(e){this._subVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"revision",{get:function(){return this._revision},set:function(e){this._revision=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_revision",{get:function(){return this._revision},set:function(e){this._revision=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"releaseType",{get:function(){return this._releaseType},set:function(e){this._releaseType=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_release_type",{get:function(){return this._releaseType},set:function(e){this._releaseType=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"installDate",{get:function(){return this._installDate},set:function(e){this._installDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_install_date",{get:function(){return this._installDate},set:function(e){this._installDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"versionString",{get:function(){return this._versionString},set:function(e){this._versionString=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ver_version_string",{get:function(){return this._versionString},set:function(e){this._versionString=e},enumerable:!0,configurable:!0}),r.attributeMap={id:{alias:"ver_id",typeScriptStyle:!0,type:"number",attribute:"_id"},ver_id:{physical:!0,type:"number",attribute:"_id"},module:{alias:"ver_module",typeScriptStyle:!0,type:"string",attribute:"_module"},ver_module:{physical:!0,type:"string",attribute:"_module"},sequence:{alias:"ver_sequence",typeScriptStyle:!0,type:"number",attribute:"_sequence"},ver_sequence:{physical:!0,type:"number",attribute:"_sequence"},version:{alias:"ver_version",typeScriptStyle:!0,type:"string",attribute:"_version"},ver_version:{physical:!0,type:"string",attribute:"_version"},subVersion:{alias:"ver_sub_version",typeScriptStyle:!0,type:"string",attribute:"_subVersion"},ver_sub_version:{physical:!0,type:"string",attribute:"_subVersion"},revision:{alias:"ver_revision",typeScriptStyle:!0,type:"string",attribute:"_revision"},ver_revision:{physical:!0,type:"string",attribute:"_revision"},releaseType:{alias:"ver_release_type",typeScriptStyle:!0,type:"string",attribute:"_releaseType"},ver_release_type:{physical:!0,type:"string",attribute:"_releaseType"},installDate:{alias:"ver_install_date",typeScriptStyle:!0,type:"Date",attribute:"_installDate"},ver_install_date:{physical:!0,type:"Date",attribute:"_installDate"},versionString:{alias:"ver_version_string",typeScriptStyle:!0,type:"SqlValueType",attribute:"_versionString"},ver_version_string:{physical:!0,type:"SqlValueType",attribute:"_versionString"}},r}(abstract_model_1.AbstractModel);exports.SmartDbVersionViewModel=SmartDbVersionViewModel;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AbstractModel, ModelAttributeMap } from "./abstract-model";
|
|
2
|
-
export declare class SqliteMasterModel extends AbstractModel {
|
|
3
|
-
private _type?;
|
|
4
|
-
private _name;
|
|
5
|
-
private _tbl_name?;
|
|
6
|
-
private _rootpage?;
|
|
7
|
-
private _sql?;
|
|
8
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
9
|
-
static getClassName(): string;
|
|
10
|
-
static getTableName(): string;
|
|
11
|
-
static from(other: any): SqliteMasterModel;
|
|
12
|
-
clone(): SqliteMasterModel;
|
|
13
|
-
getClassName(): string;
|
|
14
|
-
getTableName(): string;
|
|
15
|
-
getAttributeMap(): ModelAttributeMap;
|
|
16
|
-
getPrimaryKey(): string;
|
|
17
|
-
get type(): string;
|
|
18
|
-
set type(type: string);
|
|
19
|
-
get name(): string;
|
|
20
|
-
set name(name: string);
|
|
21
|
-
get tbl_name(): string;
|
|
22
|
-
set tbl_name(tblNname: string);
|
|
23
|
-
get tblName(): string;
|
|
24
|
-
set tblName(tblNname: string);
|
|
25
|
-
get rootpage(): number;
|
|
26
|
-
set rootpage(rootpage: number);
|
|
27
|
-
get sql(): string;
|
|
28
|
-
set sql(sql: string);
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};return function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var abstract_model_1=require("./abstract-model"),SqliteMasterModel=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return __extends(r,t),r.getClassName=function(){return"SqliteMasterModel"},r.getTableName=function(){return"sqlite_master"},r.from=function(t){var e=new r;return e.assign(t),e},r.prototype.clone=function(){return r.from(this)},r.prototype.getClassName=function(){return"SqliteMasterModel"},r.prototype.getTableName=function(){return"sqlite_master"},r.prototype.getAttributeMap=function(){return r.attributeMap},r.prototype.getPrimaryKey=function(){return"name"},Object.defineProperty(r.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"tbl_name",{get:function(){return this._tbl_name},set:function(t){this._tbl_name=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"tblName",{get:function(){return this._tbl_name},set:function(t){this._tbl_name=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"rootpage",{get:function(){return this._rootpage},set:function(t){this._rootpage=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"sql",{get:function(){return this._sql},set:function(t){this._sql=t},enumerable:!0,configurable:!0}),r.attributeMap={type:{type:"string",attribute:"_type"},name:{type:"string",attribute:"_name"},tbl_name:{type:"string",attribute:"_tbl_name"},tblName:{alias:"tbl_name",type:"string",attribute:"_tbl_name"},rootpage:{type:"number",attribute:"_rootpage"},sql:{type:"string",attribute:"_sql"}},r}(abstract_model_1.AbstractModel);exports.SqliteMasterModel=SqliteMasterModel;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AbstractModel, GenericModel, ModelAttributeMap } from "./abstract-model";
|
|
2
|
-
import { SqlValueType } from "../smart-db-interface";
|
|
3
|
-
export interface SqliteSequenceModelData extends Record<string, any> {
|
|
4
|
-
name?: SqlValueType;
|
|
5
|
-
seq?: SqlValueType;
|
|
6
|
-
}
|
|
7
|
-
export declare class SqliteSequenceModel extends AbstractModel {
|
|
8
|
-
private _name?;
|
|
9
|
-
private _seq?;
|
|
10
|
-
static readonly attributeMap: ModelAttributeMap;
|
|
11
|
-
static getClassName(): string;
|
|
12
|
-
static getTableName(): string;
|
|
13
|
-
static getPrimaryKey(): string;
|
|
14
|
-
static from(other: AbstractModel | GenericModel): SqliteSequenceModel;
|
|
15
|
-
clone(): AbstractModel;
|
|
16
|
-
getClassName(): string;
|
|
17
|
-
getTableName(): string;
|
|
18
|
-
getPrimaryKey(): string;
|
|
19
|
-
getAttributeMap(): ModelAttributeMap;
|
|
20
|
-
get name(): SqlValueType;
|
|
21
|
-
set name(name: SqlValueType);
|
|
22
|
-
get seq(): SqlValueType;
|
|
23
|
-
set seq(seq: SqlValueType);
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0});var abstract_model_1=require("./abstract-model"),SqliteSequenceModel=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return __extends(n,e),n.getClassName=function(){return"SqliteSequenceModel"},n.getTableName=function(){return"sqlite_sequence"},n.getPrimaryKey=function(){return""},n.from=function(e){var t=null;return e&&(t=new n,e.getClassName&&"SqliteSequenceModel"==e.getClassName()?Object.assign(t,e):t.assign(e)),t},n.prototype.clone=function(){return n.from(this)},n.prototype.getClassName=function(){return"SqliteSequenceModel"},n.prototype.getTableName=function(){return"sqlite_sequence"},n.prototype.getPrimaryKey=function(){return""},n.prototype.getAttributeMap=function(){return n.attributeMap},Object.defineProperty(n.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"seq",{get:function(){return this._seq},set:function(e){this._seq=e},enumerable:!0,configurable:!0}),n.attributeMap={name:{physical:!0,typeScriptStyle:!0,type:"SqlValueType",attribute:"_name"},seq:{physical:!0,typeScriptStyle:!0,type:"SqlValueType",attribute:"_seq"}},n}(abstract_model_1.AbstractModel);exports.SqliteSequenceModel=SqliteSequenceModel;
|