think-model-postgresql
Advanced tools
Comparing version 1.0.3 to 1.0.4
33
index.js
@@ -6,31 +6,6 @@ const Abstract = require('think-model-abstract'); | ||
const QUERY = Symbol('think-model-query'); | ||
const SCHEMA = Symbol('think-model-schema'); | ||
const PARSER = Symbol('think-model-parser'); | ||
module.exports = class PostgreSQLAdapter extends Abstract {}; | ||
module.exports = class PostgreSQLAdapter extends Abstract { | ||
/** | ||
* get parser instance | ||
*/ | ||
get parser() { | ||
if (this[PARSER]) return this[PARSER]; | ||
this[PARSER] = new Parser(this.model.config); | ||
return this[PARSER]; | ||
} | ||
/** | ||
* get query instance | ||
*/ | ||
get query() { | ||
if (this[QUERY]) return this[QUERY]; | ||
this[QUERY] = new Query(this.model.config); | ||
return this[QUERY]; | ||
} | ||
/** | ||
* get schema instance | ||
*/ | ||
get schema() { | ||
if (this[SCHEMA]) return this[SCHEMA]; | ||
this[SCHEMA] = new Schema(this.model.config, this.model.schema, this.model.tableName); | ||
return this[SCHEMA]; | ||
} | ||
}; | ||
module.exports.Query = Query; | ||
module.exports.Parser = Parser; | ||
module.exports.Schema = Schema; |
const {Query} = require('think-model-abstract'); | ||
const Parser = require('./parser.js'); | ||
const PostgreSQLSocket = require('./socket.js'); | ||
const PARSER = Symbol('think-model-sqlite-parser'); | ||
/** | ||
@@ -12,10 +9,2 @@ * mysql query | ||
/** | ||
* get parser instance | ||
*/ | ||
get parser() { | ||
if (this[PARSER]) return this[PARSER]; | ||
this[PARSER] = new Parser(this.config); | ||
return this[PARSER]; | ||
} | ||
/** | ||
* get socket | ||
@@ -22,0 +11,0 @@ * @param {String|Object} sql |
const helper = require('think-helper'); | ||
const {Schema} = require('think-model-abstract'); | ||
const Debounce = require('think-debounce'); | ||
const Query = require('./query.js'); | ||
const Parser = require('./parser.js'); | ||
const QUERY = Symbol('think-model-sqlite-query'); | ||
const PARSER = Symbol('think-model-sqlite-parser'); | ||
const debounce = new Debounce(); | ||
@@ -16,18 +12,2 @@ const SCHEMAS = {}; | ||
module.exports = class MysqlSchema extends Schema { | ||
/** | ||
* get query instance | ||
*/ | ||
get query() { | ||
if (this[QUERY]) return this[QUERY]; | ||
this[QUERY] = new Query(this.config); | ||
return this[QUERY]; | ||
} | ||
/** | ||
* get parset instance | ||
*/ | ||
get parser() { | ||
if (this[PARSER]) return this[PARSER]; | ||
this[PARSER] = new Parser(this.config); | ||
return this[PARSER]; | ||
} | ||
_getItemSchemaValidate(fieldData) { | ||
@@ -34,0 +14,0 @@ const validate = {}; |
{ | ||
"name": "think-model-postgresql", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "PostgreSQL adapter for ThinkJS 3.x", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22968
472