File tree 7 files changed +31
-19
lines changed
7 files changed +31
-19
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ services:
7
7
- mongodb
8
8
- postgresql
9
9
- riak
10
+ - mysql
10
11
11
12
before_script :
12
13
- sudo /etc/init.d/postgresql stop
@@ -26,4 +27,4 @@ before_script:
26
27
- mysql -u root -e "CREATE DATABASE model_test COLLATE latin1_general_cs;"
27
28
- sudo apt-get install sqlite3 libsqlite3-dev
28
29
29
- script : jake test
30
+ script : jake test --trace
Original file line number Diff line number Diff line change 1
1
var model = require ( '../../index' )
2
2
, utils = require ( 'utilities' )
3
+ , level
3
4
, mr = require ( '../transformers/mr' )
4
5
, operation = require ( '../../query/operation' )
5
6
, comparison = require ( '../../query/comparison' )
6
7
, datatypes = require ( '../../datatypes' )
7
8
, request = utils . request
8
9
, BaseAdapter = require ( '../base_adapter' ) . BaseAdapter
9
- , level = require ( 'level' )
10
10
, _baseConfig
11
11
, _data = { }
12
12
, delimiter = '!' ;
13
13
14
+ // DB lib should be locally installed in the consuming app
15
+ level = utils . file . requireLocal ( 'level' ) ;
16
+
14
17
_baseConfig = {
15
18
db : '/data/level'
16
19
} ;
Original file line number Diff line number Diff line change 1
1
var model = require ( '../../index' )
2
- , file = require ( 'utilities' ) . file
3
- , driver = require ( 'mongodb-wrapper' )
2
+ , mongo
4
3
, utils = require ( 'utilities' )
5
4
, operation = require ( '../../query/operation' )
6
5
, comparison = require ( '../../query/comparison' )
@@ -12,6 +11,9 @@ var model = require('../../index')
12
11
, _comparisonTypeMap
13
12
, _collectionizeModelName ;
14
13
14
+ // DB lib should be locally installed in the consuming app
15
+ mongo = utils . file . requireLocal ( 'mongodb-wrapper' )
16
+
15
17
_baseConfig = {
16
18
username : null
17
19
, dbname : null
@@ -177,7 +179,7 @@ utils.mixin(Adapter.prototype, new (function () {
177
179
'password' ] . forEach ( function ( c ) {
178
180
args . push ( config [ c ] ) ;
179
181
} ) ;
180
- this . client = driver . db . apply ( driver , args ) ;
182
+ this . client = mongo . db . apply ( mongo , args ) ;
181
183
} ;
182
184
183
185
this . load = function ( query , callback ) {
Original file line number Diff line number Diff line change 1
- var file = require ( 'utilities' ) . file
2
- , mysql = file . requireLocal ( 'mysql' )
1
+ var utils = require ( 'utilities' )
2
+ , mysql
3
3
, generator = require ( '../../../lib/generators/sql' )
4
- , utils = require ( 'utilities' )
5
4
, model = require ( '../../../lib' )
6
5
, Query = require ( '../../../lib/query/query' ) . Query
7
6
, BaseAdapter = require ( './base' ) . Adapter
8
7
, Adapter
9
8
, _baseConfig ;
10
9
10
+ // DB lib should be locally installed in the consuming app
11
+ mysql = utils . file . requireLocal ( 'mysql' ) ;
12
+
11
13
_baseConfig = {
12
14
host : 'localhost'
13
15
, user : process . env . USER
Original file line number Diff line number Diff line change 1
- var file = require ( 'utilities' ) . file
2
- , pg = require ( 'pg' )
1
+ var utils = require ( 'utilities' )
2
+ , pg
3
3
, generator = require ( '../../generators/sql' )
4
- , utils = require ( 'utilities' )
5
4
, model = require ( '../../index' )
6
5
, Query = require ( '../../query/query' ) . Query
7
6
, BaseAdapter = require ( './base' ) . Adapter
8
7
, Adapter
9
8
, _baseConfig ;
10
9
10
+ // DB lib should be locally installed in the consuming app
11
+ pg = utils . file . requireLocal ( 'pg' ) ;
12
+
11
13
_baseConfig = {
12
14
user : process . env . USER
13
15
, database : process . env . USER
Original file line number Diff line number Diff line change 1
- var file = require ( 'utilities' ) . file
2
- , sqlite3 = file . requireLocal ( 'sqlite3' )
1
+ var utils = require ( 'utilities' )
2
+ , sqlite3
3
3
, generator = require ( '../../../lib/generators/sql' )
4
- , utils = require ( 'utilities' )
5
4
, model = require ( '../../../lib' )
6
5
, Query = require ( '../../../lib/query/query' ) . Query
7
6
, BaseAdapter = require ( './base' ) . Adapter
8
7
, Adapter
9
8
, _baseConfig ;
10
9
10
+ // DB lib should be locally installed in the consuming app
11
+ sqlite3 = utils . file . requireLocal ( 'sqlite3' ) ;
12
+
11
13
_baseConfig = {
12
14
database : process . env . USER + '.db'
13
15
} ;
Original file line number Diff line number Diff line change 28
28
"url" : " git://github.com/mde/model.git"
29
29
},
30
30
"dependencies" : {
31
- "utilities" : " 0.0.x" ,
31
+ "utilities" : " 0.0.x"
32
+ },
33
+ "devDependencies" : {
34
+ "jake" : " 0.7.x" ,
32
35
"mongodb-wrapper" : " 0.4.x" ,
33
36
"pg" : " 2.5.x" ,
34
- "level" : " 0.17.x" ,
35
37
"mysql" : " 2.0.x" ,
38
+ "level" : " 0.17.x" ,
36
39
"sqlite3" : " 2.1.x"
37
40
},
38
- "devDependencies" : {
39
- "jake" : " 0.7.x"
40
- },
41
41
"engines" : {
42
42
"node" : " *"
43
43
}
You can’t perform that action at this time.
0 commit comments