neopg 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/ModelChain.js CHANGED
@@ -430,6 +430,10 @@ class ModelChain {
430
430
  return this.ctx.transaction(callback)
431
431
  }
432
432
 
433
+ model(name) {
434
+ return this.ctx.model(name)
435
+ }
436
+
433
437
  async _aggregate(func, field) {
434
438
  this._ensureActive()
435
439
  try {
package/lib/NeoPG.js CHANGED
@@ -204,6 +204,10 @@ class NeoPG {
204
204
  await this.sql.notify(channel, data)
205
205
  }
206
206
 
207
+ createSchema(name) {
208
+ return SchemaSync.createSchema(this.sql, name)
209
+ }
210
+
207
211
  async close() {
208
212
  await this.driver.end()
209
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neopg",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "orm for postgres",
5
5
  "keywords": [
6
6
  "neopg",
package/test/test-db.js CHANGED
@@ -141,6 +141,7 @@ const User = {
141
141
  db.add(User)
142
142
 
143
143
  ;(async () => {
144
+ await db.createSchema('test')
144
145
  await db.sync({force: true, debug: true})
145
146
  // 插入
146
147