Skip to content

Commit 410bd31

Browse files
committed
More adjustments, locked down what the advanced pool methods would look like.
1 parent c976274 commit 410bd31

File tree

1 file changed

+62
-21
lines changed

1 file changed

+62
-21
lines changed

SYNTAX_NOTES.js

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,77 +74,118 @@ User.driver.getConnection({
7474
var Waterline = require('machinepack-waterline');
7575

7676

77-
7877
// Waterline.connect()
7978
// Waterline.transaction()
8079
// Waterline.query()
8180

8281
Waterline.connect({
8382
datastore: datastore,
83+
during: function (db, done) {
84+
// db.connection;
85+
86+
// See below for info on how to use w/ ORM methods.
87+
return done();
88+
},
8489
meta: {}
8590
}).exec(/*...*/);
8691

87-
Waterline.connect({
92+
93+
Waterline.transaction({
8894
datastore: datastore,
95+
during: function (T, done) {
96+
// T.connection;
97+
98+
// See below for info on how to use w/ ORM methods.
99+
return done();
100+
},
89101
meta: {}
90102
}).exec(/*...*/);
91103

92-
Waterline.transaction({
104+
105+
// Run radar query
106+
Waterline.query({
93107
datastore: datastore,
108+
statement: {},
94109
meta: {}
95110
}).exec(/*...*/);
96111

97112

98113

99114

115+
// Probably not yet:
116+
//
117+
// // Waterline.sendNativeQuery()
118+
// // Run native query
119+
// Waterline.sendNativeQuery({
120+
// datastore: datastore,
121+
// nativeQuery: 'SELECT * FROM foo;',
122+
// meta: {}
123+
// }).exec(/*...*/);
124+
125+
126+
127+
128+
129+
130+
131+
// ========================================================================
132+
// NEW MYSQL STUFF:
133+
100134

101-
MySQL.getNewConnection({
135+
MySQL.createPool({
102136
connectionString: 'mysql://....',
103137
meta: {}
104138
}).exec(/*...*/);
105139

106-
MySQL.getConnectionFromPool({
140+
MySQL.destroyPool({
107141
pool: pool,
108142
meta: {}
109143
}).exec(/*...*/);
110144

111145

112-
MySQL.releaseConnection({
113-
connection: connection,
146+
147+
148+
MySQL.getConnectionFromPool({
149+
pool: pool,
114150
meta: {}
115151
}).exec(/*...*/);
116152

117153
MySQL.releaseConnectionToPool({
118154
connection: connection,
119-
pool
120155
meta: {}
121156
}).exec(/*...*/);
122157

123158

124159

125-
126-
MySQL.getConnectionFromCluster({
127-
cluster: cluster,
160+
MySQL.createConnection({
161+
connectionString: 'mysql://....',
128162
meta: {}
129163
}).exec(/*...*/);
130-
MySQL.releaseConnectionFromCluster({
131-
cluster: cluster,
164+
165+
MySQL.destroyConnection({
166+
connection: connection,
132167
meta: {}
133168
}).exec(/*...*/);
134169

135170

136171

137172

138173

139-
MySQL.getNewPool({
140-
connectionString: 'mysql://....',
141-
meta: {}
142-
}).exec(/*...*/);
143174

144-
MySQL.getNewPool({
145-
connectionString: 'mysql://....',
146-
meta: {}
147-
}).exec(/*...*/);
175+
176+
// Probably not yet:
177+
//
178+
// MySQL.getConnectionFromCluster({
179+
// cluster: cluster,
180+
// meta: {}
181+
// }).exec(/*...*/);
182+
// MySQL.releaseConnectionFromCluster({
183+
// cluster: cluster,
184+
// meta: {}
185+
// }).exec(/*...*/);
186+
187+
188+
148189

149190

150191

0 commit comments

Comments
 (0)