keuss 2.0.3 → 2.0.4

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/TODO CHANGED
@@ -1,5 +1,6 @@
1
1
  bugs
2
2
  -------------------------------------------------------------
3
+ * missing support for resvSize on redis-oq
3
4
 
4
5
  prio 1
5
6
  -------------------------------------------------------------
@@ -10,12 +10,11 @@ const debug = require('debug')('keuss:Queue:postgres');
10
10
  class PGQueue extends Queue {
11
11
 
12
12
 
13
- // TODO escape table name properly , as identifier, and check for reserved names using pg_get_keywords(), if the name is in select * from pg_get_keywords() where catdesc = 'R', then it should not be used
14
- //////////////////////////////////////////////
13
+ //////////////////////////////////////////////
15
14
  constructor (name, factory, opts, orig_opts) {
16
15
  super (name, factory, opts, orig_opts);
17
16
  this._pool = factory._pool;
18
- this._tbl_name = this._name;
17
+ this._tbl_name = pg.escapeIdentifier(`_k_tbl_${this._name}`);
19
18
  }
20
19
 
21
20
 
@@ -42,7 +41,7 @@ class PGQueue extends Queue {
42
41
  tries INTEGER DEFAULT 0 NOT NULL,
43
42
  reserved TIMESTAMPTZ
44
43
  );
45
- CREATE INDEX IF NOT EXISTS idx_${this._tbl_name}_mature ON ${this._tbl_name} (mature);
44
+ CREATE INDEX IF NOT EXISTS ${pg.escapeIdentifier('idx_' + this._tbl_name + '_mature')} ON ${this._tbl_name} (mature);
46
45
  `, err => {
47
46
  if (err){
48
47
  // ignore catalog issues on concurrent table creation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keuss",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "keywords": [
5
5
  "queue",
6
6
  "persistent",