Skip to content

Commit

Permalink
Add parser getter
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Aug 10, 2017
1 parent 8554dfa commit b6a9349
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
const Abstract = require('think-model-abstract');
const Query = require('./lib/query.js');
const Schema = require('./lib/schema.js');
const Parser = require('./lib/parser.js');

const QUERY = Symbol('think-model-query');
const SCHEMA = Symbol('think-model-schema');
const PARSER = Symbol('think-model-parser');

module.exports = class Mysql 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
*/
Expand Down

0 comments on commit b6a9349

Please sign in to comment.