@superhero/db 0.5.0 → 0.5.1

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.
Files changed (2) hide show
  1. package/index.js +9 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -21,11 +21,16 @@ class Db
21
21
 
22
22
  async query(file, ...ctx)
23
23
  {
24
- const
25
- query = await this.getQuery(file),
26
- response = await this.adaptor.query(query, ...ctx)
24
+ let query = await this.getQuery(file)
27
25
 
28
- return response
26
+ for(let noEscapeReplace = query.indexOf('?%s');
27
+ noEscapeReplace > -1;
28
+ noEscapeReplace = query.indexOf('?%s'))
29
+ {
30
+ query = query.replace('?%s', ctx.shift())
31
+ }
32
+
33
+ return await this.adaptor.query(query, ...ctx)
29
34
  }
30
35
 
31
36
  async formatQuery(file, formatCtx, sqlCtx)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/db",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Db interaction, designed to separate queries from the source code",
5
5
  "repository": "git@github.com:superhero/js.db.git",
6
6
  "main": "index.js",