File tree 3 files changed +4
-60
lines changed
3 files changed +4
-60
lines changed Original file line number Diff line number Diff line change @@ -3,33 +3,8 @@ const Query = require('./lib/query.js');
3
3
const Schema = require ( './lib/schema.js' ) ;
4
4
const Parser = require ( './lib/parser.js' ) ;
5
5
6
- const QUERY = Symbol ( 'think-model-query' ) ;
7
- const SCHEMA = Symbol ( 'think-model-schema' ) ;
8
- const PARSER = Symbol ( 'think-model-parser' ) ;
6
+ module . exports = class SQLiteAdapter extends Abstract { } ;
9
7
10
- module . exports = class SQLiteAdapter extends Abstract {
11
- /**
12
- * get parser instance
13
- */
14
- get parser ( ) {
15
- if ( this [ PARSER ] ) return this [ PARSER ] ;
16
- this [ PARSER ] = new Parser ( this . model . config ) ;
17
- return this [ PARSER ] ;
18
- }
19
- /**
20
- * get query instance
21
- */
22
- get query ( ) {
23
- if ( this [ QUERY ] ) return this [ QUERY ] ;
24
- this [ QUERY ] = new Query ( this . model . config ) ;
25
- return this [ QUERY ] ;
26
- }
27
- /**
28
- * get schema instance
29
- */
30
- get schema ( ) {
31
- if ( this [ SCHEMA ] ) return this [ SCHEMA ] ;
32
- this [ SCHEMA ] = new Schema ( this . model . config , this . model . schema , this . model . tableName ) ;
33
- return this [ SCHEMA ] ;
34
- }
35
- } ;
8
+ module . exports . Query = Query ;
9
+ module . exports . Parser = Parser ;
10
+ module . exports . Schema = Schema ;
Original file line number Diff line number Diff line change 1
1
const { Query} = require ( 'think-model-abstract' ) ;
2
- const Parser = require ( './parser.js' ) ;
3
2
const SQLiteSocket = require ( './socket.js' ) ;
4
3
5
- const PARSER = Symbol ( 'think-model-sqlite-parser' ) ;
6
-
7
4
/**
8
5
* mysql query
9
6
*/
10
7
module . exports = class SQLiteQuery extends Query {
11
- /**
12
- * get parser instance
13
- */
14
- get parser ( ) {
15
- if ( this [ PARSER ] ) return this [ PARSER ] ;
16
- this [ PARSER ] = new Parser ( this . config ) ;
17
- return this [ PARSER ] ;
18
- }
19
8
/**
20
9
* get socket
21
10
* @param {String|Object } sql
Original file line number Diff line number Diff line change 1
1
const helper = require ( 'think-helper' ) ;
2
2
const { Schema} = require ( 'think-model-abstract' ) ;
3
3
const Debounce = require ( 'think-debounce' ) ;
4
- const Query = require ( './query.js' ) ;
5
- const Parser = require ( './parser.js' ) ;
6
4
7
- const QUERY = Symbol ( 'think-model-sqlite-query' ) ;
8
- const PARSER = Symbol ( 'think-model-sqlite-parser' ) ;
9
5
const debounce = new Debounce ( ) ;
10
6
const SCHEMAS = { } ;
11
7
12
8
/**
13
9
* mysql Schema
14
10
*/
15
11
module . exports = class MysqlSchema extends Schema {
16
- /**
17
- * get query instance
18
- */
19
- get query ( ) {
20
- if ( this [ QUERY ] ) return this [ QUERY ] ;
21
- this [ QUERY ] = new Query ( this . config ) ;
22
- return this [ QUERY ] ;
23
- }
24
- /**
25
- * get parset instance
26
- */
27
- get parser ( ) {
28
- if ( this [ PARSER ] ) return this [ PARSER ] ;
29
- this [ PARSER ] = new Parser ( this . config ) ;
30
- return this [ PARSER ] ;
31
- }
32
12
_getItemSchemaValidate ( fieldData ) {
33
13
const validate = { } ;
34
14
switch ( fieldData . tinyType ) {
You can’t perform that action at this time.
0 commit comments