forked from coldbox-modules/qb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleConfig.cfc
42 lines (35 loc) · 1.52 KB
/
ModuleConfig.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
component {
this.title = "qb";
this.author = "Eric Peterson";
this.webURL = "https://github.com/coldbox-modules/qb";
this.description = "A query builder for the rest of us";
this.cfmapping = "qb";
function configure() {
settings = {
defaultGrammar: "AutoDiscover@qb",
defaultReturnFormat: "array",
preventDuplicateJoins: false,
strictDateDetection: false,
numericSQLType: "CF_SQL_NUMERIC"
};
interceptorSettings = { customInterceptionPoints: "preQBExecute,postQBExecute" };
}
function onLoad() {
binder
.map( alias = "QueryUtils@qb", force = true )
.to( "qb.models.Query.QueryUtils" )
.initArg( name = "strictDateDetection", value = settings.strictDateDetection )
.initArg( name = "numericSQLType", value = settings.numericSQLType );
binder
.map( alias = "QueryBuilder@qb", force = true )
.to( "qb.models.Query.QueryBuilder" )
.initArg( name = "grammar", ref = settings.defaultGrammar )
.initArg( name = "utils", ref = "QueryUtils@qb" )
.initArg( name = "preventDuplicateJoins", value = settings.preventDuplicateJoins )
.initArg( name = "returnFormat", value = settings.defaultReturnFormat );
binder
.map( alias = "SchemaBuilder@qb", force = true )
.to( "qb.models.Schema.SchemaBuilder" )
.initArg( name = "grammar", ref = settings.defaultGrammar );
}
}