diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e4902f..ba72052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ - Added `branch` and `do` to Static Datums (`expr`) - Fixed `add` and `sub` actually being exponential in static datums +- Fix postgres implementation so it actually works... whoops! +- Add indexCreate, indexList, and indexDrop to the Table object +- Update deps to latest +- Cleaned up some SQL Queries for Streams +- Cleaned up the Static Datum definition +- Catch null values when resolving them # v2.0 diff --git a/lib/common/datum.js b/lib/common/datum.js index 3a53e56..387afe8 100644 --- a/lib/common/datum.js +++ b/lib/common/datum.js @@ -46,7 +46,7 @@ class AbstractDatumPartial { return this; } substr(str) { - this.query.push({ cmd: 'includes', params: [str] }); + this.query.push({ cmd: 'substr', params: [str] }); return this; } len() { diff --git a/lib/common/datum.js.map b/lib/common/datum.js.map index 2240a84..784f906 100644 --- a/lib/common/datum.js.map +++ b/lib/common/datum.js.map @@ -1 +1 @@ -{"version":3,"file":"datum.js","sourceRoot":"","sources":["../../src/common/datum.ts"],"names":[],"mappings":";;AAGA,MAAsB,oBAAoB;IAA1C;QACY,UAAK,GAAiB,EAAE,CAAC;IA+IrC,CAAC;IA3IC,QAAQ;IAER,EAAE,CAAC,GAAG,MAAkB;QACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,EAAE,CAAC,GAAG,MAAkB;QACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,UAAU;IAEV,EAAE,CAAC,GAAG,IAAsB;QAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,C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,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtD,OAAO,IAAW,CAAC;IACrB,CAAC;IACD,MAAM,CAAC,SAA+D;QACpE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACxD,OAAO,IAAW,CAAC;IACrB,CAAC;IACD,KAAK,CAAC,CAAgB;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAW,CAAC;IACrB,CAAC;IACD,KAAK,CAAI,GAAG,MAAgB;QAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAClD,OAAO,IAAW,CAAC;IACrB,CAAC;IACD,GAAG,CAAa,SAAsC;QACpD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;CAMF;AAhJD,oDAgJC"} \ No newline at end of file diff --git a/lib/common/static-datum.js b/lib/common/static-datum.js index 160223a..f7c68ee 100644 --- a/lib/common/static-datum.js +++ b/lib/common/static-datum.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const util_1 = require("./util"); const selectable_1 = require("./selectable"); const datum_1 = require("./datum"); -class SQLite3StaticDatumPartial extends datum_1.AbstractDatumPartial { +class StaticDatum extends datum_1.AbstractDatumPartial { constructor(initialValue) { super(); this.initialValue = initialValue; @@ -187,13 +187,13 @@ async function resolveQueryStatic(query, initialValue) { } exports.resolveQueryStatic = resolveQueryStatic; function exprQuery(initialValue, query) { - const datum = selectable_1.makeSelector(new SQLite3StaticDatumPartial(initialValue)); + const datum = selectable_1.makeSelector(new StaticDatum(initialValue)); datum.query = query; return datum; } exports.exprQuery = exprQuery; function expr(initialValue) { - return selectable_1.makeSelector(new SQLite3StaticDatumPartial(initialValue)); + return selectable_1.makeSelector(new StaticDatum(initialValue)); } exports.expr = expr; //# sourceMappingURL=static-datum.js.map \ No newline at end of file diff --git a/lib/common/static-datum.js.map b/lib/common/static-datum.js.map index 916fe7b..a8fa8b2 100644 --- a/lib/common/static-datum.js.map +++ b/lib/common/static-datum.js.map @@ -1 +1 @@ -{"version":3,"file":"static-datum.js","sourceRoot":"","sources":["../../src/common/static-datum.ts"],"names":[],"mappings":";;AACA,iCAA8D;AAC9D,6CAA6D;AAC7D,mCAA+C;AAG/C,MAAM,yBAAmC,SAAQ,4BAAuB;IAEtE,YAAoB,YAAsB;QACxC,KAAK,EAAE,CAAC;QADU,iBAAY,GAAZ,YAAY,CAAU;IAE1C,CAAC;IAED,IAAI,CAA4B,SAAmB;QAGjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,KAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAEM,KAAK,UAAU,kBAAkB,CACtC,KAA4B,EAC5B,YAAsB;IAEt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\ No newline at end of file +{"version":3,"file":"static-datum.js","sourceRoot":"","sources":["../../src/common/static-datum.ts"],"names":[],"mappings":";;AACA,iCAA8D;AAC9D,6CAA6D;AAC7D,mCAA+C;AAG/C,MAAM,WAAqB,SAAQ,4BAAuB;IAExD,YAAoB,YAAsB;QACxC,KAAK,EAAE,CAAC;QADU,iBAAY,GAAZ,YAAY,CAAU;IAE1C,CAAC;IAED,IAAI,CAA4B,SAAmB;QAGjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,KAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAEM,KAAK,UAAU,kBAAkB,CACtC,KAA4B,EAC5B,YAAsB;IAEtB,IAAI,KAAK,GAAQ,MAAM,mBAAY,CAAC,YAAY,CAAC,CAAC;IAElD,KAAI,MAAM,CAAC,IAAI,KAAK,EAAE;QAEpB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAChC,IAAG,MAAM,EAAE,EAAE,oBAAoB;YAC/B,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;gBACrC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,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,CAAC,KAAK,YAAY,KAAK,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC5E,MAAM,IAAI,GAAG,EAAE,CAAC;gBAChB,KAAI,MAAM,IAAI,IAAI,KAAK,EAAE;oBACvB,IAAI,CAAC,IAAI,CAAC,MAAM,mBAAY,CAAE,MAAM,CAAC,CAAC,CAA6C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;iBACnG;gBACD,KAAK,GAAG,IAAI,CAAC;gBACb,MAAM;YAER;gBACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC;SAC9E;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AA/KD,gDA+KC;AAED,SAAgB,SAAS,CAAU,YAAiC,EAAE,KAAmB;IACvF,MAAM,KAAK,GAAG,yBAAY,CAAI,IAAI,WAAW,CAAI,YAAY,CAAC,CAAQ,CAAC;IACvE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,OAAO,KAAK,CAAC;AACf,CAAC;AAJD,8BAIC;AAED,SAAgB,IAAI,CAAU,YAAiC;IAC7D,OAAO,yBAAY,CAAI,IAAI,WAAW,CAAI,YAAY,CAAC,CAAQ,CAAC;AAClE,CAAC;AAFD,oBAEC"} \ No newline at end of file diff --git a/lib/common/util.js b/lib/common/util.js index 43c5ec0..9c38d99 100644 --- a/lib/common/util.js +++ b/lib/common/util.js @@ -6,6 +6,8 @@ function createQuery(run) { } exports.createQuery = createQuery; async function resolveValue(value) { + if (value == null) + return value; if (typeof value['run'] === 'function') return await value.run(); return value; diff --git a/lib/common/util.js.map b/lib/common/util.js.map index 6b6d1d0..057da41 100644 --- a/lib/common/util.js.map +++ b/lib/common/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":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CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;qBACtB;oBACD,MAAM;gBACR;oBACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;aAC1D;SACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA7BD,kDA6BC"} \ No newline at end of file diff --git a/lib/postgres/database.d.ts b/lib/postgres/database.d.ts index f35fc01..efa33ff 100644 --- a/lib/postgres/database.d.ts +++ b/lib/postgres/database.d.ts @@ -8,7 +8,7 @@ export declare class PostgresDatabase implements Database { logger?: string; client?: Client; } & PoolConfig): Promise; - private readonly typemaps; + private get typemaps(); readonly valueTypeMap: { string: string; bool: string; diff --git a/lib/postgres/database.js b/lib/postgres/database.js index 1bf4d89..e829760 100644 --- a/lib/postgres/database.js +++ b/lib/postgres/database.js @@ -13,7 +13,7 @@ class PostgresDatabase { this.typemapsTableName = '__reql_typemap__'; this.valueTypeMap = { string: 'text', - bool: 'numeric', + bool: 'boolean', number: 'numeric', object: 'text', }; diff --git a/lib/postgres/database.js.map b/lib/postgres/database.js.map index d694eac..0fde0e3 100644 --- a/lib/postgres/database.js.map +++ b/lib/postgres/database.js.map @@ -1 +1 @@ -{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/postgres/database.ts"],"names":[],"mappings":";;AAEA,yCAA6C;AAC7C,yDAA8C;AAC9C,mCAAsC;AACtC,uCAAuF;AAGvF,MAAa,gBAAgB;IAA7B;QAImB,iBAAY,GAA2B,MAAM,CAAC,MAAM,CAAC;YACpE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;YACjC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;SAClC,CAAC,CAAC;QAEc,sBAAiB,GAAG,kBAAkB,CAAC;QAgB/C,iBAAY,GAAG;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS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,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF;AA5FD,4CA4FC;AAEM,KAAK,UAAU,MAAM,CAAC,OAA2D;IACtF,MAAM,EAAE,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAClC,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC;AACZ,CAAC;AAJD,wBAIC;AACD,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/postgres/query-datum.js b/lib/postgres/query-datum.js index a96b334..416f8d7 100644 --- a/lib/postgres/query-datum.js +++ b/lib/postgres/query-datum.js @@ -64,7 +64,7 @@ class PostgresQueryDatumPartial extends datum_1.AbstractDatumPartial { if (query) query += ` AND `; if (sel2) - query += `${sel} NOT LIKE '%"${sel2}":${params[0]}%`; + query += `${sel} NOT LIKE '%"${sel2}":${params[0].replace(/^'|'$/g, '"')}%'`; else query += `${sel} != ${params[0]}`; sel = sel2 = ''; @@ -72,17 +72,17 @@ class PostgresQueryDatumPartial extends datum_1.AbstractDatumPartial { case 'startsWith': if (sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); - sel = `(${sel} LIKE ${'"%' + params[0].slice(1)})`; + sel = `(${sel} LIKE '%${params[0].slice(1, -1)})'`; break; case 'endsWith': if (sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); - sel = `(${sel} LIKE ${params[0].slice(0, -1) + '%"'})`; + sel = `(${sel} LIKE '${params[0].slice(1, -1)})%')`; break; - case 'includes': + case 'substr': if (sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); - sel = `(${sel} LIKE ${'"%' + params[0].slice(1, -1) + '%"'})`; + sel = `(${sel} LIKE '%${params[0].slice(1, -1)}%')`; break; case 'length': if (sel2) diff --git a/lib/postgres/query-datum.js.map b/lib/postgres/query-datum.js.map index 545932e..589be96 100644 --- a/lib/postgres/query-datum.js.map +++ b/lib/postgres/query-datum.js.map @@ -1 +1 @@ -{"version":3,"file":"query-datum.js","sourceRoot":"","sources":["../../src/postgres/query-datum.ts"],"names":[],"mappings":";;AACA,yCAA8C;AAC9C,qDAAqE;AACrE,2CAAuD;AACvD,iCAA+B;AAE/B,MAAM,yBAAmC,SAAQ,4BAAuB;IACtE,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IAE1B,IAAI,CAA4B,SAAmB;QAGjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,IAAI;QACF,MAAM,KAAK,GAAG,gBAAgB,EAAK,CAAC;QACnC,KAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1C,OAAO,KAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,IAAI,GAAG,EAAE,CAAC;QAEd,KAAI,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;YAEzB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC5C,IAAG,MAAM,EAAE,EAAE,oBAAoB;gBAC/B,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,E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,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBAER,SAAS,4BAA4B;oBACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,GAAG,0BAA0B,CAAC,CAAC;aAC/E;SACF;QACD,IAAG,KAAK,IAAI,GAAG;YACb,OAAO,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC;aAC1B,IAAG,GAAG;YACT,OAAO,GAAG,CAAC;;YAEX,OAAO,KAAK,CAAC;IACjB,CAAC;CACF;AAED,SAAgB,gBAAgB;IAC9B,OAAO,yBAAY,CAAI,IAAI,yBAAyB,EAAE,CAAQ,CAAC;AACjE,CAAC;AAFD,4CAEC"} \ No newline at end of file +{"version":3,"file":"query-datum.js","sourceRoot":"","sources":["../../src/postgres/query-datum.ts"],"names":[],"mappings":";;AACA,yCAA8C;AAC9C,qDAAqE;AACrE,2CAAuD;AACvD,iCAA+B;AAE/B,MAAM,yBAAmC,SAAQ,4BAAuB;IACtE,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IAE1B,IAAI,CAA4B,SAAmB;QAGjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,IAAI;QACF,MAAM,KAAK,GAAG,gBAAgB,EAAK,CAAC;QACnC,KAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1C,OAAO,KAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,GAAG,GAAG,EAAE,CAAC;Q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AAK,CAAC,2CAA2C,CAAC,CAAC;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBACR,KAAK,IAAI;oBACP,IAAG,IAAI;wBACL,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBAER,SAAS,4BAA4B;oBACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,GAAG,0BAA0B,CAAC,CAAC;aAC/E;SACF;QACD,IAAG,KAAK,IAAI,GAAG;YACb,OAAO,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC;aAC1B,IAAG,GAAG;YACT,OAAO,GAAG,CAAC;;YAEX,OAAO,KAAK,CAAC;IACjB,CAAC;CACF;AAED,SAAgB,gBAAgB;IAC9B,OAAO,yBAAY,CAAI,IAAI,yBAAyB,EAAE,CAAQ,CAAC;AACjE,CAAC;AAFD,4CAEC"} \ No newline at end of file diff --git a/lib/postgres/selection.js b/lib/postgres/selection.js index 9789558..288f596 100644 --- a/lib/postgres/selection.js +++ b/lib/postgres/selection.js @@ -42,9 +42,9 @@ class PostgresSelectionPartial extends stream_1.PostgresStream { return 0; const poost = (post ? ' AND ' + post : '') + (limit ? ' LIMIT ' + limit : ''); return this.db.get(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)} WHERE ${selection}${poost}`) - .then(a => limit ? Math.min(a['COUNT(*)'], limit) : a['COUNT(*)']); + .then(a => limit ? Math.min(a['count'], limit) : a['count']); } - return this.db.get(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)} WHERE ${selection}`).then(a => a['COUNT(*)']); + return this.db.get(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)} WHERE ${selection}`).then(a => a['count']); })); } delete() { @@ -118,7 +118,6 @@ function createSelection(db, tableName, keys, index, types) { }); o.__proto__ = instance; return o; - return o; } exports.createSelection = createSelection; //# sourceMappingURL=selection.js.map \ No newline at end of file diff --git a/lib/postgres/selection.js.map b/lib/postgres/selection.js.map index 92e03d9..846542e 100644 --- a/lib/postgres/selection.js.map +++ b/lib/postgres/selection.js.map @@ -1 +1 @@ -{"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/postgres/selection.ts"],"names":[],"mappings":";;AAEA,yCAAgF;AAChF,qCAA0C;AAC1C,yDAAyD;AACzD,iCAA+B;AAE/B,MAAa,wBAAkC,SAAQ,uBAAiB;IAEtE,YAAY,EAA2B,EAAE,SAAwB,EACvD,IAAkB,EAAU,KAAoB,EAAU,KAA2B;QAC7F,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QADb,SAAI,GAAJ,IAAI,CAAc;QAAU,UAAK,GAAL,KAAK,CAAe;QAAU,UAAK,GAAL,KAAK,CAAsB;IAE/F,CAAC;IAEO,KAAK,CAAC,aAAa;QACzB,MAAM,IAAI,GAAG,MAAM,mBAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAG,CAAC,IAAI,CAAC,MAAM;YACb,OAAO,OAAO,CAAC;QAEjB,MAAM,KAAK,GAAG,MAAM,mBAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAG,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;YAChB,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC;QAEhD,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,KAAI,MAAM,GAAG,IAAI,IAAI,EAAE;YACrB,IAAG,CAAC,SAAS,EAAE;gBACb,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,I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O,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACV,CAAQ,CAAC;IAClC,CAAS,CAAC,SAAS,GAAG,QAAQ,CAAC;IAChC,OAAO,CAAQ,CAAC;AAClB,CAAC;AA9BD,0CA8BC"} \ No newline at end of file diff --git a/lib/postgres/stream.js b/lib/postgres/stream.js index aab098c..c7d2541 100644 --- a/lib/postgres/stream.js +++ b/lib/postgres/stream.js @@ -54,7 +54,7 @@ class PostgresStream { if (!this.query.length && !this.sel) return { cmdsApplied: 0, select: '*' }; if (!this.query.length) - return { cmdsApplied: 0, select: `[${this.sel}]` }; + return { cmdsApplied: 0, select: `${JSON.stringify(this.sel)}` }; const tableName = await util_1.resolveValue(this.tableName); const primaryKey = await this.db.getPrimaryKey(tableName); let select = this.sel ? `${JSON.stringify(this.sel)}` : '*'; @@ -82,7 +82,7 @@ class PostgresStream { post = `${JSON.stringify(primaryKey)} in (SELECT ${JSON.stringify(primaryKey)}` + ` FROM ${JSON.stringify(tableName)} WHERE ${query})`; else - post += ` AND (${query})`; + post = post.slice(0, -1) + ` AND (${query}))`; } else if (!res) { return { cmdsApplied: 0, kill: true }; diff --git a/lib/postgres/stream.js.map b/lib/postgres/stream.js.map index b009a75..d1d92da 100644 --- a/lib/postgres/stream.js.map +++ b/lib/postgres/stream.js.map @@ -1 +1 @@ -{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/postgres/stream.ts"],"names":[],"mappings":";;AAEA,yCAAsE;AACtE,+CAAiD;AAIjD,MAAsB,cAAc;IAKlC,YAAsB,EAA2B,EAAY,SAAwB;QAA/D,OAAE,GAAF,EAAE,CAAyB;QAAY,cAAS,GAAT,SAAS,CAAe;QAH3E,UAAK,GAAiB,EAAE,CAAC;IAGsD,CAAC;IAE1F,IAAI,CAA4B,SAAmB;QAIjD,IAAG,CAAC,IAAI,CAAC,GAAG;YACV,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;;YAErB,IAAI,CAAC,KAAK,CAAC,IAAI,C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CAsIC"} \ No newline at end of file diff --git a/lib/postgres/table.d.ts b/lib/postgres/table.d.ts index f2db842..8d34c71 100644 --- a/lib/postgres/table.d.ts +++ b/lib/postgres/table.d.ts @@ -1,9 +1,9 @@ -import { Table, TablePartial, Value, Datum, SchemaEntry, DeepPartial, WriteResult, SingleSelection, Selection } from '../types'; +import { Table, TablePartial, IndexChangeResult, Value, Datum, SchemaEntry, DeepPartial, WriteResult, SingleSelection, Selection } from '../types'; import { WrappedPostgresDatabase } from './wrapper'; import { PostgresStream } from './stream'; export declare class PostgresTablePartial extends PostgresStream implements TablePartial { private types; - private readonly primaryIndexGetter; + private get primaryIndexGetter(); constructor(db: WrappedPostgresDatabase, tableName: Value, types: Value); filter(predicate: DeepPartial | ((doc: Datum) => Value)): Selection; fork(): never; @@ -22,6 +22,11 @@ export declare class PostgresTablePartial extends PostgresStream imp insert(obj: T, options?: { conflict: 'error' | 'replace' | 'update'; }): Datum>; + indexCreate(key: U): Datum; + indexCreate(key: any): Datum; + indexDrop(key: U): Datum; + indexDrop(key: any): Datum; + indexList(): Datum; run(): Promise; } interface PostgresTable extends PostgresTablePartial, Table { diff --git a/lib/postgres/table.js b/lib/postgres/table.js index 572aafe..e6a2a09 100644 --- a/lib/postgres/table.js +++ b/lib/postgres/table.js @@ -33,9 +33,9 @@ class PostgresTablePartial extends stream_1.PostgresStream { this.query = []; const poost = (post ? ` WHERE ${post}` : '') + (limit ? `LIMIT ${limit}` : ''); return this.db.get(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}${poost}`) - .then(a => limit ? Math.min(a['COUNT(*)'], limit) : a['COUNT(*)']); + .then(a => limit ? Math.min(a['count'], limit) : a); } - return this.db.get(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}`).then(a => a['COUNT(*)']); + return this.db.get(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}`).then(a => a['count']); })); } delete() { @@ -104,6 +104,28 @@ class PostgresTablePartial extends stream_1.PostgresStream { return ret; })); } + // indexCreate(name: Value, indexFunction: (doc: Datum) => Value): Datum; + indexCreate(key) { + return static_datum_1.expr(util_1.createQuery(async () => { + const tableName = await util_1.resolveValue(this.tableName); + await this.db.exec(`CREATE INDEX ${JSON.stringify(tableName + '_' + key)} ON ${JSON.stringify(tableName)}(${JSON.stringify(key)})`); + return { created: 1 }; + })); + } + indexDrop(key) { + return static_datum_1.expr(util_1.createQuery(async () => { + const tableName = await util_1.resolveValue(this.tableName); + await this.db.exec(`DROP INDEX ${JSON.stringify(tableName + '_' + key)}`); + return { dropped: 1 }; + })); + } + indexList() { + return static_datum_1.expr(util_1.createQuery(async () => { + const tableName = await util_1.resolveValue(this.tableName); + const rows = await this.db.all(`SELECT indexname FROM pg_indexes WHERE tablename=${util_2.safen(tableName)};`); + return rows.map(row => row.indexname.slice(tableName.length + 1)); + })); + } async run() { const tableName = await util_1.resolveValue(this.tableName); if (this.sel || this.query.length) { diff --git a/lib/postgres/table.js.map b/lib/postgres/table.js.map index afad297..7781580 100644 --- a/lib/postgres/table.js.map +++ b/lib/postgres/table.js.map @@ -1 +1 @@ -{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/postgres/table.ts"],"names":[],"mappings":";;AAKA,yCAAgF;AAEhF,qCAA0C;AAC1C,yDAAyD;AACzD,yDAA2D;AAC3D,2CAA8C;AAC9C,iCAA+B;AAE/B,MAAa,oBAA8B,SAAQ,uBAAiB;IAMlE,YAAY,EAA2B,EAAE,SAAwB,EAAU,KAA2B;QAAI,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAApD,UAAK,GAAL,KAAK,CAAsB;IAA0B,CAAC;IAJjI,IAAY,kBAAkB;QAC5B,OAAO,kBAAW,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,mBAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC;IAID,MAAM,CAAC,SAA+D;QACpE,OAAO,KAAK,CAA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CAAC,CAAC,CAAC;QACpI,MAAM,CAAC,SAA+D;YACpE,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC3B,OAAO,CAAQ,CAAC;QAClB,CAAC;QAED,MAAM,KAA4B,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAE7D,IAAI,KAAY,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACzC,GAAG,KAAK,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAEhC,QAAQ;QAER,GAAG,CAAC,GAAQ,IAAwB,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,GAA4C,IAAkB,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEzG,aAAa;QAEb,MAAM,CAAC,GAAM,EAAE,OAAsD;YACnE,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;KACiB,CAAQ,CAAC;IAC9B,CAAS,CAAC,SAAS,GAAG,QAAQ,CAAC;IAChC,OAAO,CAAQ,CAAC;AAClB,CAAC;AAtCD,kCAsCC"} \ No newline at end of file diff --git a/lib/postgres/wrapper.d.ts b/lib/postgres/wrapper.d.ts index 2037efc..2ae7295 100644 --- a/lib/postgres/wrapper.d.ts +++ b/lib/postgres/wrapper.d.ts @@ -3,7 +3,7 @@ export interface WrappedPostgresDatabase { close(): Promise; query(query: string, values?: any[]): Promise>; get(query: string, values?: any[]): Promise; - all(query: string, values?: any[]): Promise; + all(query: string, values?: any[]): Promise; exec(query: string, values?: any[]): Promise; getPrimaryKey(tableName: string): Promise; getKeys(tableName: string): Promise<{ diff --git a/lib/postgres/wrapper.js b/lib/postgres/wrapper.js index 83d5e8c..fd69029 100644 --- a/lib/postgres/wrapper.js +++ b/lib/postgres/wrapper.js @@ -4,7 +4,6 @@ const log4js_api_1 = require("@log4js-node/log4js-api"); const pg_1 = require("pg"); const util_1 = require("./util"); class PostgresDatabase { - get client() { return this._client || this.pool; } constructor(options) { options = Object.assign({ logger: 'pg' }, options); if (options.client) @@ -12,6 +11,7 @@ class PostgresDatabase { this.logger = log4js_api_1.getLogger(options.logger); this.options = options; } + get client() { return this._client || this.pool; } async init() { if (this._client) return this._client.connect(); diff --git a/lib/postgres/wrapper.js.map b/lib/postgres/wrapper.js.map index 9201f04..f530f0d 100644 --- a/lib/postgres/wrapper.js.map +++ b/lib/postgres/wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/postgres/wrapper.ts"],"names":[],"mappings":";;AAAA,wDAA4D;AAC5D,2BAAuH;AACvH,iCAA+B;AA2B/B,MAAM,gBAAgB;IAIpB,IAAW,MAAM,KAAmB,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAGvE,YAAY,OAA2D;QACrE,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QACnD,IAAG,OAAO,CAAC,MAAM;YACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,sBAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAG,IAAI,CAAC,OAAO;YACb,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,SAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAEM,KAAK;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAU,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CAAC,KAAK,CAAmB;;;;;0BAKd,YAAK,CAAC,SAAS,CAAC;2BACf,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChF,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,SAAiB;QACpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAC7B,+EAA+E,YAAK,CAAC,SAAS,CAAC,GAAG,CAAC;aACnG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACvD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,UAAU,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;CACF;AAEM,KAAK,UAAU,MAAM,CAAC,OAA2D;IACtF,MAAM,EAAE,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC;AACZ,CAAC;AAJD,wBAIC;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/sqlite3/database.d.ts b/lib/sqlite3/database.d.ts index 505e241..8e88d50 100644 --- a/lib/sqlite3/database.d.ts +++ b/lib/sqlite3/database.d.ts @@ -7,7 +7,7 @@ export declare class SQLite3Database implements Database { filename?: string; logger?: string; }): Promise; - private readonly typemaps; + private get typemaps(); readonly valueTypeMap: { string: string; bool: string; diff --git a/lib/sqlite3/query-datum.js b/lib/sqlite3/query-datum.js index a82aa64..f23b32b 100644 --- a/lib/sqlite3/query-datum.js +++ b/lib/sqlite3/query-datum.js @@ -79,7 +79,7 @@ class SQLite3QueryDatumPartial extends datum_1.AbstractDatumPartial { throw new Error('Can only use "eq" and "ne" on sub-object!'); sel = `(${sel} LIKE ${params[0].slice(0, -1) + '%"'})`; break; - case 'includes': + case 'substr': if (sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); sel = `(${sel} LIKE ${'"%' + params[0].slice(1, -1) + '%"'})`; diff --git a/lib/sqlite3/query-datum.js.map b/lib/sqlite3/query-datum.js.map index a9057db..f41fd01 100644 --- a/lib/sqlite3/query-datum.js.map +++ b/lib/sqlite3/query-datum.js.map @@ -1 +1 @@ -{"version":3,"file":"query-datum.js","sourceRoot":"","sources":["../../src/sqlite3/query-datum.ts"],"names":[],"mappings":";;AACA,yCAA8C;AAC9C,qDAAqE;AACrE,2CAAuD;AACvD,iCAA+B;AAE/B,MAAM,wBAAkC,SAAQ,4BAAuB;IACrE,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IAE1B,IAAI,CAA4B,SAAmB;QAGjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,IAAI;QACF,MAAM,KAAK,GAAG,gBAAgB,EAAK,CAAC;QACnC,KAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1C,OAAO,KAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,IAAI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C;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBACR,KAAK,IAAI;oBACP,IAAG,IAAI;wBACL,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBAER,SAAS,4BAA4B;oBACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,GAAG,0BAA0B,CAAC,CAAC;aAC/E;SACF;QACD,IAAG,KAAK,IAAI,GAAG;YACb,OAAO,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC;aAC1B,IAAG,GAAG;YACT,OAAO,GAAG,CAAC;;YAEX,OAAO,KAAK,CAAC;IACjB,CAAC;CACF;AAED,SAAgB,gBAAgB;IAC9B,OAAO,yBAAY,CAAI,IAAI,wBAAwB,EAAE,CAAQ,CAAC;AAChE,CAAC;AAFD,4CAEC"} \ No newline at end of file +{"version":3,"file":"query-datum.js","sourceRoot":"","sources":["../../src/sqlite3/query-datum.ts"],"names":[],"mappings":";;AACA,yCAA8C;AAC9C,qDAAqE;AACrE,2CAAuD;AACvD,iCAA+B;AAE/B,MAAM,wBAAkC,SAAQ,4BAAuB;IACrE,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IAE1B,IAAI,CAA4B,SAAmB;QAGjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,IAAI;QACF,MAAM,KAAK,GAAG,g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AK,IAAI;oBACP,IAAG,IAAI;wBACL,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEhC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBACR,KAAK,IAAI;oBACP,IAAG,IAAI;wBACL,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBACR,KAAK,IAAI;oBACP,IAAG,IAAI;wBACL,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;yBAC1D,IAAG,GAAG;wBACT,GAAG,GAAG,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAEjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBACjE,MAAM;gBAER,SAAS,4BAA4B;oBACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,GAAG,0BAA0B,CAAC,CAAC;aAC/E;SACF;QACD,IAAG,KAAK,IAAI,GAAG;YACb,OAAO,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC;aAC1B,IAAG,GAAG;YACT,OAAO,GAAG,CAAC;;YAEX,OAAO,KAAK,CAAC;IACjB,CAAC;CACF;AAED,SAAgB,gBAAgB;IAC9B,OAAO,yBAAY,CAAI,IAAI,wBAAwB,EAAE,CAAQ,CAAC;AAChE,CAAC;AAFD,4CAEC"} \ No newline at end of file diff --git a/lib/sqlite3/stream.js b/lib/sqlite3/stream.js index 6850cc3..56cac4a 100644 --- a/lib/sqlite3/stream.js +++ b/lib/sqlite3/stream.js @@ -81,7 +81,7 @@ class SQLite3Stream { if (!post) post = `[${primaryKey}] in (SELECT [${primaryKey}] FROM [${tableName}] WHERE ${query})`; else - post += ` AND (${query})`; + post = post.slice(0, -1) + ` AND (${query}))`; } else if (!res) { return { cmdsApplied: 0, kill: true }; diff --git a/lib/sqlite3/stream.js.map b/lib/sqlite3/stream.js.map index 9fbb820..01298f1 100644 --- a/lib/sqlite3/stream.js.map +++ b/lib/sqlite3/stream.js.map @@ -1 +1 @@ -{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/sqlite3/stream.ts"],"names":[],"mappings":";;AAEA,yCAAsE;AACtE,+CAAiD;AAIjD,MAAsB,aAAa;IAKjC,YAAsB,EAA0B,EAAY,SAAwB;QAA9D,OAAE,GAAF,EAAE,CAAwB;QAAY,cAAS,GAAT,SAAS,CAAe;QAH1E,UAAK,GAAiB,EAAE,CAAC;IAGqD,CAAC;IAEzF,IAAI,CAA4B,SAAmB;QAIjD,IAAG,CAAC,IAAI,CAAC,GAAG;YACV,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;;YAErB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAEvD,OAAO,IAAW,CAAC;IACrB,CAAC;IAMD,MAAM,CAAC,SAA+D;QACpE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACxD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,GAAG,CAAU,SAAsC;QACjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,IAAW,CAAC;IACrB,CAAC;IAED,QAAQ;QACN,IAAG,CAAC,IAAI,CAAC,KAAK,CAA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oBACd,MAAM;gBACR,KAAK,KAAK,CAAC,CAAC,OAAO;gBACnB;oBACE,IAAG,IAAI;wBACL,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;;wBACrD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;aAC9C;SACF;QACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAC9C,CAAC;CACF;AArID,sCAqIC"} \ No newline at end of file diff --git a/lib/sqlite3/table.d.ts b/lib/sqlite3/table.d.ts index dcc6e9f..57e2fba 100644 --- a/lib/sqlite3/table.d.ts +++ b/lib/sqlite3/table.d.ts @@ -1,9 +1,9 @@ -import { Table, TablePartial, Value, Datum, SchemaEntry, DeepPartial, WriteResult, SingleSelection, Selection } from '../types'; +import { Table, TablePartial, Value, Datum, SchemaEntry, DeepPartial, WriteResult, SingleSelection, Selection, IndexChangeResult } from '../types'; import { WrappedSQLite3Database } from './wrapper'; import { SQLite3Stream } from './stream'; export declare class SQLite3TablePartial extends SQLite3Stream implements TablePartial { private types; - private readonly primaryIndexGetter; + private get primaryIndexGetter(); constructor(db: WrappedSQLite3Database, tableName: Value, types: Value); filter(predicate: DeepPartial | ((doc: Datum) => Value)): Selection; fork(): never; @@ -22,6 +22,11 @@ export declare class SQLite3TablePartial extends SQLite3Stream imple insert(obj: T, options?: { conflict: 'error' | 'replace' | 'update'; }): Datum>; + indexCreate(key: U): Datum; + indexCreate(key: any): Datum; + indexDrop(key: U): Datum; + indexDrop(key: any): Datum; + indexList(): Datum; run(): Promise; } interface SQLite3Table extends SQLite3TablePartial, Table { diff --git a/lib/sqlite3/table.js b/lib/sqlite3/table.js index dc4d3bb..674695e 100644 --- a/lib/sqlite3/table.js +++ b/lib/sqlite3/table.js @@ -107,6 +107,28 @@ class SQLite3TablePartial extends stream_1.SQLite3Stream { return ret; })); } + // indexCreate(name: Value, indexFunction: (doc: Datum) => Value): Datum; + indexCreate(key) { + return static_datum_1.expr(util_1.createQuery(async () => { + const tableName = await util_1.resolveValue(this.tableName); + await this.db.exec(`CREATE INDEX ${JSON.stringify(tableName + '_' + key)} ON ${JSON.stringify(tableName)}(${JSON.stringify(key)})`); + return { created: 1 }; + })); + } + indexDrop(key) { + return static_datum_1.expr(util_1.createQuery(async () => { + const tableName = await util_1.resolveValue(this.tableName); + await this.db.exec(`DROP INDEX ${JSON.stringify(tableName + '_' + key)}`); + return { dropped: 1 }; + })); + } + indexList() { + return static_datum_1.expr(util_1.createQuery(async () => { + const tableName = await util_1.resolveValue(this.tableName); + const rows = await this.db.all(`SELECT name FROM sqlite_master WHERE type="index" AND tbl_name=${JSON.stringify(tableName)}`); + return rows.map(row => row.name.startsWith(tableName) ? row.name.slice(tableName.length + 1) : row.name); + })); + } async run() { const tableName = await util_1.resolveValue(this.tableName); if (this.sel || this.query.length) { diff --git a/lib/sqlite3/table.js.map b/lib/sqlite3/table.js.map index 42ff0f1..00c2eb6 100644 --- a/lib/sqlite3/table.js.map +++ b/lib/sqlite3/table.js.map @@ -1 +1 @@ -{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/sqlite3/table.ts"],"names":[],"mappings":";;AAKA,yCAAgF;AAEhF,qCAAyC;AACzC,yDAAyD;AACzD,yDAA2D;AAC3D,2CAA8C;AAC9C,iCAA+B;AAE/B,MAAa,mBAA6B,SAAQ,sBAAgB;IAMhE,YAAY,EAA0B,EAAE,SAAwB,EAAU,KAA2B;QAAI,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAApD,UAAK,GAAL,KAAK,CAAsB;IAA0B,CAAC;IAJhI,IAAY,kBAAkB;QAC5B,OAAO,kBAAW,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,mBAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC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,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;KACiB,CAAQ,CAAC;IAC9B,CAAS,CAAC,SAAS,GAAG,QAAQ,CAAC;IAChC,OAAO,CAAQ,CAAC;AAClB,CAAC;AAtCD,kCAsCC"} \ No newline at end of file diff --git a/lib/test.js b/lib/test.js index ccb87e6..8bf5742 100644 --- a/lib/test.js +++ b/lib/test.js @@ -22,6 +22,7 @@ async function test(create, log) { const logger = log4js_1.getLogger(log || 'test'); const db = await create(); const console = { log: (a, ...b) => logger.info(a, ...b) }; + let errored = false; // begin sample try { await db.tableCreate('my-table', [ @@ -69,9 +70,15 @@ async function test(create, log) { logger.info('testTbl.get("lime")("value")("type"): ', await testTbl.get('lime')('value')('type').run()); logger.info('testTbl.filter(doc => doc("key").len().ge(4)): ', await testTbl.filter(doc => doc('key').len().ge(4)).run()); logger.info('testTbl.get("foo")("count").do(v => v.add(1)).gt(4).branch("yes", () => "no"))', await testTbl.get('foo')('count').do(v => v.add(1)).gt(4).branch('yes', () => 'no').run()); + logger.info('testTbl.indexList(): ', await testTbl.indexList().run()); + logger.info('testTbl.indexCreate("value"): ', await testTbl.indexCreate('value').run()); + logger.info('testTbl.indexList(): ', await testTbl.indexList().run()); + logger.info('testTbl.indexDrop("value"): ', await testTbl.indexDrop('value').run()); + logger.info('testTbl.indexList(): ', await testTbl.indexList().run()); } catch (e) { logger.error(e); + errored = true; } // cleanup! const list = await db.tableList().run(); @@ -81,16 +88,21 @@ async function test(create, log) { await db.tableDrop('test-table').run().catch(e => logger.error(e)); if (list.includes('__reql_typemap__')) await db.tableDrop('__reql_typemap__').run().catch(e => logger.error(e)); - return db.close(); + await db.close(); + return errored; } const rootLog = log4js_1.getLogger('root'); (async () => { + const errored = []; for (const [create, log] of [ [() => index_1.createPostgresDatabase({ client: new pg_1.Client({ user: 'bobtest', password: 'keyboardcat', database: 'test' }) }), 'pg'], [index_1.createSQLite3Database, 'sqlite3'], ]) { - await test(create, log).catch(e => rootLog.error(e)); + if (await test(create, log).catch(e => { rootLog.error(e); return true; })) + errored.push(log); } + for (const db of errored) + rootLog.error(db + ' test failed!'); })().then(() => { process.exit(0); }).catch(e => { diff --git a/lib/test.js.map b/lib/test.js.map index ec6a708..bfa93d4 100644 --- a/lib/test.js.map +++ b/lib/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;AAAA,uCAAqC;AACrC,mCAAwD;AACxD,mCAIiB;AACjB,2BAA4B;AAE5B,MAAM,KAAK,GAAG,OAAO,CAAC;AACtB,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;AACpE,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;AAEnF,KAAK,UAAU,IAAI,CAAC,MAA+B,EAAE,GAAY;IAE/D,kBAAS,CAAC;QACR,SAAS,EAAE;YACT,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE;YAClC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;YAC/C,GAAG,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE;YAC5E,GAAG,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;SACnE;QACD,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE;SACrE;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,kBAAS,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC;IAExC,MAAM,EA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a/lib/types.d.ts b/lib/types.d.ts index a2f4f60..b1439d4 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -113,6 +113,11 @@ export interface TablePartial extends SelectionPartial { insert(obj: T, options?: { conflict: 'error' | 'replace' | 'update'; }): Datum>; + indexCreate(key: U): Datum; + indexCreate(key: any): Datum; + indexDrop(key: U): Datum; + indexDrop(key: any): Datum; + indexList(): Datum; } export interface Table extends TablePartial, Selection { fork(): never; diff --git a/package-lock.json b/package-lock.json index 200556e..fc5a6a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "reql-bridge", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.0.tgz", + "integrity": "sha512-AN2IR/wCUYsM+PdErq6Bp3RFTXl8W0p9Nmymm7zkpsCmh+r/YYcckaCGpU8Q/mEKmST19kkGRaG42A/jxOWwBA==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.0" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.0.tgz", + "integrity": "sha512-OsdTJbHlPtIk2mmtwXItYrdmalJ8T0zpVzNAbKSkHshuywj7zb29Y09McV/jQsQunc/nEyHiPV2oy9llYMLqxw==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -29,6 +29,32 @@ "resolved": "https://registry.npmjs.org/@log4js-node/log4js-api/-/log4js-api-1.0.2.tgz", "integrity": "sha512-6SJfx949YEWooh/CUPpJ+F491y4BYJmknz4hUN1+RHvKoUEynKbRmhnwbk/VLmh4OthLLDNCyWXfbh4DG1cTXA==" }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -59,9 +85,9 @@ "dev": true }, "@types/pg": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.11.0.tgz", - "integrity": "sha512-wXduaNIDQp7w9ediwIRAH+FpdgtOlOwFVlYe9DtBPDczxcHgfb0blLNR7yYVNUMhspC0xOLykOvMDHavbO0Sxg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.14.1.tgz", + "integrity": "sha512-gQgg4bLuykokypx4O1fwEzl5e6UjjyaBtN3znn5zhm0YB9BnKyHDw+e4cQY9rAPzpdM2qpJbn9TNzUazbmTsdw==", "dev": true, "requires": { "@types/node": "*", @@ -69,18 +95,15 @@ } }, "@types/pg-types": { - "version": "1.11.4", - "resolved": "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.4.tgz", - "integrity": "sha512-WdIiQmE347LGc1Vq3Ki8sk3iyCuLgnccqVzgxek6gEHp2H0p3MQ3jniIHt+bRODXKju4kNQ+mp53lmP5+/9moQ==", - "dev": true, - "requires": { - "moment": ">=2.14.0" - } + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.5.tgz", + "integrity": "sha512-L8ogeT6vDzT1vxlW3KITTCt+BVXXVkLXfZ/XNm6UqbcJgxf+KPO7yjWx7dQQE8RW07KopL10x2gNMs41+IkMGQ==", + "dev": true }, "@types/sqlite3": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@types/sqlite3/-/sqlite3-3.1.5.tgz", - "integrity": "sha512-upsrd1zEYMa4Y+prurQ+vpo5SN63BUF6tOjeTv3ziF+9W9PHVh4/S5cy0qAqkHvmOEm/AZhEKd7V/0bR2udmFw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@types/sqlite3/-/sqlite3-3.1.6.tgz", + "integrity": "sha512-OBsK0KIGUICExQ/ZvnPY4cKx5Kz4NcrVyGTIvOL5y4ajXu7r++RfBajfpGfGDmDVCKcoCDX1dO84/oeyeITnxA==", "dev": true, "requires": { "@types/node": "*" @@ -93,15 +116,26 @@ "optional": true }, "abstract-leveldown": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", + "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", "optional": true, "requires": { "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", "xtend": "~4.0.0" } }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -161,18 +195,9 @@ "dev": true }, "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "arrify": { @@ -209,9 +234,9 @@ "optional": true }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", + "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==", "optional": true }, "balanced-match": { @@ -237,6 +262,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -290,11 +324,17 @@ } }, "chownr": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", + "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==", "optional": true }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -326,9 +366,9 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "concat-map": { @@ -367,9 +407,9 @@ } }, "date-format": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", - "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", + "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==", "dev": true }, "debug": { @@ -412,37 +452,55 @@ "optional": true }, "deferred-leveldown": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.1.0.tgz", - "integrity": "sha512-PvDY+BT2ONu2XVRgxHb77hYelLtMYxKSGuWuJJdVRXh9ntqx9GYTFJno/SKAz5xcd+yjQwyQeIZrUPjPvA52mg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", "optional": true, "requires": { - "abstract-leveldown": "~6.0.0", + "abstract-leveldown": "~6.2.1", "inherits": "^2.0.3" } }, "del": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", - "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", + "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", "dev": true, "requires": { - "@types/glob": "^7.1.1", - "globby": "^6.1.0", - "is-path-cwd": "^2.0.0", - "is-path-in-cwd": "^2.0.0", - "p-map": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^2.6.3" + "globby": "^10.0.1", + "graceful-fs": "^4.2.2", + "is-glob": "^4.0.1", + "is-path-cwd": "^2.2.0", + "is-path-inside": "^3.0.1", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "del-cli": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-2.0.0.tgz", - "integrity": "sha512-IREsO6mjSTxxvWLKMMUi1G0izhqEBx7qeDkOJ6H3+TJl8gQl6x5C5hK4Sm1GJ51KodUMR6O7HuIhnF24Edua3g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-3.0.0.tgz", + "integrity": "sha512-J4HDC2mpcN5aopya4VdkyiFXZaqAoo7ua9VpKbciX3DDUSbtJbPMc3ivggJsAAgS6EqonmbenIiMhBGtJPW9FA==", "dev": true, "requires": { - "del": "^4.1.1", + "del": "^5.1.0", "meow": "^5.0.0" } }, @@ -465,11 +523,20 @@ "optional": true }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -534,12 +601,43 @@ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "optional": true }, + "fast-glob": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", + "integrity": "sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2" + } + }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "optional": true }, + "fastq": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", + "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "dev": true, + "requires": { + "reusify": "^1.0.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -584,12 +682,12 @@ } }, "fs-minipass": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", - "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs.realpath": { @@ -635,25 +733,29 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", "dev": true, "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" } }, "graceful-fs": { @@ -691,13 +793,10 @@ "optional": true }, "hosted-git-info": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.2.tgz", - "integrity": "sha512-CyjlXII6LMsPMyUzxpTt8fzh5QwzGqPmQXgY/Jyf4Zfp27t/FvfhwoE/8laaMUcMy816CkWF20I7NeQhwwY88w==", - "dev": true, - "requires": { - "lru-cache": "^5.1.1" - } + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "dev": true }, "http-signature": { "version": "1.2.0", @@ -719,19 +818,25 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", "optional": true, "requires": { "minimatch": "^3.0.4" } }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, "inflight": { @@ -760,6 +865,12 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -769,29 +880,32 @@ "number-is-nan": "^1.0.0" } }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", "dev": true }, - "is-path-in-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", - "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", - "dev": true, - "requires": { - "is-path-inside": "^2.1.0" - } - }, "is-path-inside": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", - "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", - "dev": true, - "requires": { - "path-is-inside": "^1.0.2" - } + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true }, "is-plain-obj": { "version": "1.1.0", @@ -900,14 +1014,14 @@ } }, "level-iterator-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.1.tgz", - "integrity": "sha512-pSZWqXK6/yHQkZKCHrR59nKpU5iqorKM22C/BOHTb/cwNQ2EOZG+bovmFFGcOgaBoF3KxqJEI27YwewhJQTzsw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", "optional": true, "requires": { - "inherits": "^2.0.1", - "readable-stream": "^3.0.2", - "xtend": "^4.0.0" + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" }, "dependencies": { "readable-stream": { @@ -923,15 +1037,25 @@ } } }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "optional": true, + "requires": { + "xtend": "^4.0.2" + } + }, "levelup": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.1.0.tgz", - "integrity": "sha512-+Qhe2/jb5affN7BeFgWUUWVdYoGXO2nFS3QLEZKZynnQyP9xqA+7wgOz3fD8SST2UKpHQuZgjyJjTcB2nMl2dQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.3.2.tgz", + "integrity": "sha512-cRTjU4ktWo59wf13PHEiOayHC3n0dOh4i5+FHr4tv4MX9+l7mqETicNq3Aj07HKlLdk0z5muVoDL2RD+ovgiyA==", "optional": true, "requires": { - "deferred-leveldown": "~5.1.0", + "deferred-leveldown": "~5.3.0", "level-errors": "~2.0.0", "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", "xtend": "~4.0.0" } }, @@ -945,14 +1069,6 @@ "parse-json": "^4.0.0", "pify": "^3.0.0", "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } } }, "locate-path": { @@ -966,16 +1082,16 @@ } }, "log4js": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-5.0.0.tgz", - "integrity": "sha512-yySdC7uCTYo1cCW3Of79PFQVrR1NVK3XxdFozEkLOYhpFsyhVE68yizMdJV7pcrwhvop5J+GGamwb2ejrDt6ww==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.1.0.tgz", + "integrity": "sha512-fSCHMYsMJbHwfNTuMlopVVcfkKwIRLh5mpNZGB2oBbnSmr3yUTo4tL4xGBA0/q29xowlu96eTXGghJFNhPXMnA==", "dev": true, "requires": { - "date-format": "^2.1.0", + "date-format": "^3.0.0", "debug": "^4.1.1", "flatted": "^2.0.1", "rfdc": "^1.1.4", - "streamroller": "^2.0.0" + "streamroller": "^2.2.3" }, "dependencies": { "debug": { @@ -999,15 +1115,6 @@ "signal-exit": "^3.0.0" } }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "map-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", @@ -1031,19 +1138,35 @@ "yargs-parser": "^10.0.0" } }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", "optional": true }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "optional": true, "requires": { - "mime-db": "1.40.0" + "mime-db": "1.43.0" } }, "minimatch": { @@ -1070,9 +1193,9 @@ } }, "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "optional": true, "requires": { "safe-buffer": "^5.1.2", @@ -1080,12 +1203,12 @@ } }, "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mkdirp": { @@ -1096,12 +1219,6 @@ "minimist": "0.0.8" } }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1165,15 +1282,24 @@ } }, "npm-bundled": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", "optional": true }, "npm-packlist": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", - "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz", + "integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==", "optional": true, "requires": { "ignore-walk": "^3.0.1", @@ -1207,7 +1333,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "optional": true }, "once": { "version": "1.4.0", @@ -1258,10 +1385,13 @@ } }, "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } }, "p-try": { "version": "1.0.0", @@ -1296,12 +1426,6 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -1309,21 +1433,10 @@ "dev": true }, "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "performance-now": { "version": "2.1.0", @@ -1332,15 +1445,16 @@ "optional": true }, "pg": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/pg/-/pg-7.12.1.tgz", - "integrity": "sha512-l1UuyfEvoswYfcUe6k+JaxiN+5vkOgYcVSbSuw3FvdLqDbaoa2RJo1zfJKfPsSYPFVERd4GHvX3s2PjG1asSDA==", + "version": "7.17.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-7.17.1.tgz", + "integrity": "sha512-SYWEip6eADsgDQIZk0bmB2JDOrC8Xu6z10KlhlXl03NSomwVmHB6ZTVyDCwOfT6bXHI8QndJdk5XxSSRXikaSA==", "optional": true, "requires": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", "pg-connection-string": "0.1.3", - "pg-pool": "^2.0.4", + "pg-packet-stream": "^1.1.0", + "pg-pool": "^2.0.9", "pg-types": "^2.1.0", "pgpass": "1.x", "semver": "4.3.2" @@ -1366,10 +1480,16 @@ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", "optional": true }, + "pg-packet-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pg-packet-stream/-/pg-packet-stream-1.1.0.tgz", + "integrity": "sha512-kRBH0tDIW/8lfnnOyTwKD23ygJ/kexQVXZs7gEyBljw4FYqimZFxnMMx50ndZ8In77QgfGuItS5LLclC2TtjYg==", + "optional": true + }, "pg-pool": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.7.tgz", - "integrity": "sha512-UiJyO5B9zZpu32GSlP0tXy8J2NsJ9EFGFfz5v6PSbdz/1hBLX1rNiiy5+mAm5iJJYwfCv4A0EBcQLGWwjbpzZw==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.9.tgz", + "integrity": "sha512-gNiuIEKNCT3OnudQM2kvgSnXsLkSpd6mS/fRnqs6ANtrke6j8OY5l9mnAryf1kgwJMWLg0C1N1cYTZG1xmEYHQ==", "optional": true }, "pg-types": { @@ -1394,27 +1514,18 @@ "split": "^1.0.0" } }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "picomatch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", + "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", "dev": true }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, "postgres-array": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", @@ -1455,9 +1566,9 @@ "optional": true }, "psl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", - "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", + "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==", "optional": true }, "punycode": { @@ -1507,6 +1618,17 @@ "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + } } }, "read-pkg-up": { @@ -1520,9 +1642,9 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "optional": true, "requires": { "core-util-is": "~1.0.0", @@ -1542,6 +1664,14 @@ "requires": { "indent-string": "^3.0.0", "strip-indent": "^2.0.0" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + } } }, "request": { @@ -1581,6 +1711,12 @@ "path-parse": "^1.0.6" } }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rfdc": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.1.4.tgz", @@ -1588,13 +1724,20 @@ "dev": true }, "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "optional": true, "requires": { "glob": "^7.1.3" } }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -1629,6 +1772,12 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1636,9 +1785,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -1693,9 +1842,9 @@ "dev": true }, "sqlite3": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.9.tgz", - "integrity": "sha512-IkvzjmsWQl9BuBiM4xKpl5X8WCR4w0AeJHRdobCdXZ8dT/lNc1XS6WqvY35N6+YzIIgzSBeY5prdFObID9F9tA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.1.1.tgz", + "integrity": "sha512-CvT5XY+MWnn0HkbwVKJAyWEMfzpAPwnTiB3TobA5Mri44SrTovmmh499NPQP+gatkeOipqPlBLel7rn4E/PCQg==", "optional": true, "requires": { "nan": "^2.12.1", @@ -1721,9 +1870,9 @@ } }, "streamroller": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.0.0.tgz", - "integrity": "sha512-F3YGsrfLJMqS2QB5NEV1qd8ZluCNw+srK3t/q3odEwXpy+FF9uR7pPg9YiJxi7jKKahMdZBPBL668lf3Lnk43A==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.3.tgz", + "integrity": "sha512-AegmvQsscTRhHVO46PhCDerjIpxi7E+d2GxgUDu+nzw/HuLnUdxHWr6WQ+mVn/4iJgMKKFFdiUwFcFRDvcjCtw==", "dev": true, "requires": { "date-format": "^2.1.0", @@ -1731,6 +1880,12 @@ "fs-extra": "^8.1.0" }, "dependencies": { + "date-format": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", + "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", + "dev": true + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -1799,14 +1954,14 @@ } }, "tar": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", - "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "optional": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.5", + "minipass": "^2.8.6", "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", @@ -1819,6 +1974,15 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "optional": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -1850,16 +2014,16 @@ "dev": true }, "tslint": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", - "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", - "diff": "^3.2.0", + "diff": "^4.0.1", "glob": "^7.1.1", "js-yaml": "^3.13.1", "minimatch": "^3.0.4", @@ -1895,9 +2059,9 @@ "optional": true }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", "dev": true }, "universalify": { @@ -1922,9 +2086,9 @@ "optional": true }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "optional": true }, "validate-npm-package-license": { @@ -1969,9 +2133,10 @@ "optional": true }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "optional": true }, "yargs-parser": { "version": "10.1.0", diff --git a/package.json b/package.json index 335adb2..8445470 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reql-bridge", - "version": "2.0.0", + "version": "2.1.0", "description": "ReQL(-like) interpreter for a multitude of databases", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -31,17 +31,17 @@ "@log4js-node/log4js-api": "^1.0.2" }, "optionalDependencies": { - "levelup": "^4.1.0", - "pg": "^7.12.1", - "sqlite3": "^4.0.9" + "levelup": "^4.3.2", + "pg": "^7.17.1", + "sqlite3": "^4.1.1" }, "devDependencies": { - "@types/pg": "^7.11.0", - "@types/sqlite3": "^3.1.5", - "del-cli": "^2.0.0", - "log4js": "^5.0.0", - "source-map-support": "^0.5.13", - "tslint": "^5.18.0", - "typescript": "^3.5.3" + "@types/pg": "^7.14.1", + "@types/sqlite3": "^3.1.6", + "del-cli": "^3.0.0", + "log4js": "^6.1.0", + "source-map-support": "^0.5.16", + "tslint": "^5.20.1", + "typescript": "^3.7.4" } } diff --git a/src/common/datum.ts b/src/common/datum.ts index 8946e9a..c2666cf 100644 --- a/src/common/datum.ts +++ b/src/common/datum.ts @@ -62,7 +62,7 @@ export abstract class AbstractDatumPartial implements DatumPartial { return this as any; } substr(str: Value): T extends string ? Datum : never { - this.query.push({ cmd: 'includes', params: [str] }); + this.query.push({ cmd: 'substr', params: [str] }); return this as any; } len(): T extends string ? Datum : never { diff --git a/src/common/static-datum.ts b/src/common/static-datum.ts index f3633dd..a1627f8 100644 --- a/src/common/static-datum.ts +++ b/src/common/static-datum.ts @@ -4,14 +4,14 @@ import { SelectableDatum, makeSelector } from './selectable'; import { AbstractDatumPartial } from './datum'; import { QueryEntry } from './query-entry'; -class SQLite3StaticDatumPartial extends AbstractDatumPartial implements DatumPartial, SelectableDatum { +class StaticDatum extends AbstractDatumPartial implements DatumPartial, SelectableDatum { constructor(private initialValue: Value) { super(); } _sel(attribute: Value): - U extends keyof T ? SQLite3StaticDatumPartial : SQLite3StaticDatumPartial { + U extends keyof T ? StaticDatum : StaticDatum { this.query.push({ cmd: 'sel', params: [attribute] }); return this as any; @@ -208,11 +208,11 @@ export async function resolveQueryStatic( } export function exprQuery(initialValue: Value | Value, query: QueryEntry[]): Datum { - const datum = makeSelector(new SQLite3StaticDatumPartial(initialValue)) as any; + const datum = makeSelector(new StaticDatum(initialValue)) as any; datum.query = query; return datum; } export function expr(initialValue: Value | Value): Datum { - return makeSelector(new SQLite3StaticDatumPartial(initialValue)) as any; + return makeSelector(new StaticDatum(initialValue)) as any; } diff --git a/src/common/util.ts b/src/common/util.ts index 2cc0350..dd72ce3 100644 --- a/src/common/util.ts +++ b/src/common/util.ts @@ -6,6 +6,8 @@ export function createQuery(run: () => Promise): Query { } export async function resolveValue(value: Value): Promise { + if(value == null) + return value as any; if(typeof value['run'] === 'function') return await (value as any).run(); return value as any; diff --git a/src/postgres/database.ts b/src/postgres/database.ts index bef65ce..bf1b0bd 100644 --- a/src/postgres/database.ts +++ b/src/postgres/database.ts @@ -33,7 +33,7 @@ export class PostgresDatabase implements Database { readonly valueTypeMap = { string: 'text', - bool: 'numeric', // yep + bool: 'boolean', number: 'numeric', object: 'text', // yeeep }; @@ -83,7 +83,7 @@ export class PostgresDatabase implements Database { return expr(createQuery(async () => { const result = await this.db.all<{ name: string - }[]>(`SELECT table_name AS name FROM information_schema.tables WHERE table_schema = 'public'`); + }>(`SELECT table_name AS name FROM information_schema.tables WHERE table_schema = 'public'`); return result.map(a => a.name); })); } diff --git a/src/postgres/query-datum.ts b/src/postgres/query-datum.ts index 52e9c14..a756948 100644 --- a/src/postgres/query-datum.ts +++ b/src/postgres/query-datum.ts @@ -76,7 +76,7 @@ class PostgresQueryDatumPartial extends AbstractDatumPartial impleme if(query) query += ` AND `; if(sel2) - query += `${sel} NOT LIKE '%"${sel2}":${params[0]}%`; + query += `${sel} NOT LIKE '%"${sel2}":${params[0].replace(/^'|'$/g, '"')}%'`; else query += `${sel} != ${params[0]}`; @@ -86,17 +86,17 @@ class PostgresQueryDatumPartial extends AbstractDatumPartial impleme case 'startsWith': if(sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); - sel = `(${sel} LIKE ${'"%' + (params[0] as string).slice(1)})`; + sel = `(${sel} LIKE '%${(params[0] as string).slice(1, -1)})'`; break; case 'endsWith': if(sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); - sel = `(${sel} LIKE ${(params[0] as string).slice(0, -1) + '%"'})`; + sel = `(${sel} LIKE '${(params[0] as string).slice(1, -1)})%')`; break; - case 'includes': + case 'substr': if(sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); - sel = `(${sel} LIKE ${'"%' + (params[0] as string).slice(1, -1) + '%"'})`; + sel = `(${sel} LIKE '%${(params[0] as string).slice(1, -1)}%')`; break; case 'length': if(sel2) diff --git a/src/postgres/selection.ts b/src/postgres/selection.ts index b5822c9..cf64d63 100644 --- a/src/postgres/selection.ts +++ b/src/postgres/selection.ts @@ -46,12 +46,12 @@ export class PostgresSelectionPartial extends PostgresStream impleme const poost = (post ? ' AND ' + post : '') + (limit ? ' LIMIT ' + limit : ''); return this.db.get<{ - 'COUNT(*)': number + 'count': number }>(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)} WHERE ${selection}${poost}`) - .then(a => limit ? Math.min(a['COUNT(*)'], limit) : a['COUNT(*)']); + .then(a => limit ? Math.min(a['count'], limit) : a['count']); } - return this.db.get<{ 'COUNT(*)': number }> - (`SELECT COUNT(*) FROM ${JSON.stringify(tableName)} WHERE ${selection}`).then(a => a['COUNT(*)']); + return this.db.get<{ 'count': number }> + (`SELECT COUNT(*) FROM ${JSON.stringify(tableName)} WHERE ${selection}`).then(a => a['count']); })); } @@ -148,5 +148,4 @@ export function createSelection(db: WrappedPostgresDatabase, tableName: } as SelectionPartial) as any; (o as any).__proto__ = instance; return o as any; - return o as any; } diff --git a/src/postgres/stream.ts b/src/postgres/stream.ts index 312687a..a29d710 100644 --- a/src/postgres/stream.ts +++ b/src/postgres/stream.ts @@ -73,7 +73,7 @@ export abstract class PostgresStream implements StreamPartial, Selec if(!this.query.length && !this.sel) return { cmdsApplied: 0, select: '*' }; if(!this.query.length) - return { cmdsApplied: 0, select: `[${this.sel}]` }; + return { cmdsApplied: 0, select: `${JSON.stringify(this.sel)}` }; const tableName = await resolveValue(this.tableName); const primaryKey = await this.db.getPrimaryKey(tableName); @@ -107,7 +107,7 @@ export abstract class PostgresStream implements StreamPartial, Selec post = `${JSON.stringify(primaryKey)} in (SELECT ${JSON.stringify(primaryKey)}` + ` FROM ${JSON.stringify(tableName)} WHERE ${query})`; else - post += ` AND (${query})`; + post = post.slice(0, -1) + ` AND (${query}))`; } else if(!res) { return { cmdsApplied: 0, kill: true }; diff --git a/src/postgres/table.ts b/src/postgres/table.ts index ae627c9..3f2deda 100644 --- a/src/postgres/table.ts +++ b/src/postgres/table.ts @@ -1,5 +1,5 @@ import { - Table, TablePartial, + Table, TablePartial, IndexChangeResult, Value, Datum, SchemaEntry, DeepPartial, WriteResult, SingleSelection, Selection, Query, Stream } from '../types'; @@ -41,10 +41,10 @@ export class PostgresTablePartial extends PostgresStream implements this.query = []; const poost = (post ? ` WHERE ${post}` : '') + (limit ? `LIMIT ${limit}` : ''); - return this.db.get<{ 'COUNT(*)': number }>(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}${poost}`) - .then(a => limit ? Math.min(a['COUNT(*)'], limit) : a['COUNT(*)']); + return this.db.get<{ 'count': number }>(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}${poost}`) + .then(a => limit ? Math.min(a['count'], limit) : a as any); } - return this.db.get<{ 'COUNT(*)': number }>(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}`).then(a => a['COUNT(*)']); + return this.db.get<{ 'count': number }>(`SELECT COUNT(*) FROM ${JSON.stringify(tableName)}`).then(a => a['count']); })); } @@ -128,6 +128,37 @@ export class PostgresTablePartial extends PostgresStream implements })); } + indexCreate(key: U): Datum; + indexCreate(key: any): Datum; + // indexCreate(name: Value, indexFunction: (doc: Datum) => Value): Datum; + indexCreate(key: any): Datum { + return expr(createQuery(async () => { + const tableName = await resolveValue(this.tableName); + await this.db.exec(`CREATE INDEX ${JSON.stringify(tableName + '_' + key)} ON ${JSON.stringify(tableName)}(${JSON.stringify(key)})`); + return { created: 1 } as IndexChangeResult; + })); + } + + indexDrop(key: U): Datum; + // indexDrop(name: Value): Datum; + indexDrop(key: any): Datum; + indexDrop(key: any): Datum { + return expr(createQuery(async () => { + const tableName = await resolveValue(this.tableName); + await this.db.exec(`DROP INDEX ${JSON.stringify(tableName + '_' + key)}`); + return { dropped: 1 } as IndexChangeResult; + })); + } + + indexList(): Datum { + return expr(createQuery(async () => { + const tableName = await resolveValue(this.tableName); + const rows = await this.db.all<{ indexname: string }>( + `SELECT indexname FROM pg_indexes WHERE tablename=${safen(tableName)};`); + return rows.map(row => row.indexname.slice(tableName.length + 1)); + })); + } + async run(): Promise { const tableName = await resolveValue(this.tableName); if(this.sel || this.query.length) { diff --git a/src/postgres/wrapper.ts b/src/postgres/wrapper.ts index 6e3d460..331da19 100644 --- a/src/postgres/wrapper.ts +++ b/src/postgres/wrapper.ts @@ -6,7 +6,7 @@ export interface WrappedPostgresDatabase { close(): Promise; query(query: string, values?: any[]): Promise>; get(query: string, values?: any[]): Promise; - all(query: string, values?: any[]): Promise; + all(query: string, values?: any[]): Promise; exec(query: string, values?: any[]): Promise; // extensions @@ -68,12 +68,12 @@ class PostgresDatabase implements WrappedPostgresDatabase { return this.client.query(query, values).then(a => a.rows && a.rows.length ? a.rows[0] : null); } - public all(query: string, values?: any[]): Promise { + public all(query: string, values?: any[]): Promise { this.logger.trace('All: ' + (values ? values.reduce((acc, v, i) => acc.replace('$' + i, String(v)), query) : query)); - return this.client.query(query, values).then(a => a.rows as T); + return this.client.query(query, values).then(a => a.rows as T[]); } public exec(query: string, values?: any[]): Promise { diff --git a/src/sqlite3/query-datum.ts b/src/sqlite3/query-datum.ts index 267f018..397428f 100644 --- a/src/sqlite3/query-datum.ts +++ b/src/sqlite3/query-datum.ts @@ -93,7 +93,7 @@ class SQLite3QueryDatumPartial extends AbstractDatumPartial implemen throw new Error('Can only use "eq" and "ne" on sub-object!'); sel = `(${sel} LIKE ${(params[0] as string).slice(0, -1) + '%"'})`; break; - case 'includes': + case 'substr': if(sel2) throw new Error('Can only use "eq" and "ne" on sub-object!'); sel = `(${sel} LIKE ${'"%' + (params[0] as string).slice(1, -1) + '%"'})`; diff --git a/src/sqlite3/stream.ts b/src/sqlite3/stream.ts index da70ef4..efa4d48 100644 --- a/src/sqlite3/stream.ts +++ b/src/sqlite3/stream.ts @@ -106,7 +106,7 @@ export abstract class SQLite3Stream implements StreamPartial, Select if(!post) post = `[${primaryKey}] in (SELECT [${primaryKey}] FROM [${tableName}] WHERE ${query})`; else - post += ` AND (${query})`; + post = post.slice(0, -1) + ` AND (${query}))`; } else if(!res) { return { cmdsApplied: 0, kill: true }; diff --git a/src/sqlite3/table.ts b/src/sqlite3/table.ts index 229d813..5de246d 100644 --- a/src/sqlite3/table.ts +++ b/src/sqlite3/table.ts @@ -1,7 +1,7 @@ import { Table, TablePartial, Value, Datum, SchemaEntry, DeepPartial, WriteResult, - SingleSelection, Selection, Query, Stream + SingleSelection, Selection, Query, Stream, IndexChangeResult } from '../types'; import { createQuery, resolveValue, coerceCorrectReturn } from '../common/util'; import { WrappedSQLite3Database } from './wrapper'; @@ -131,6 +131,37 @@ export class SQLite3TablePartial extends SQLite3Stream implements Ta })); } + indexCreate(key: U): Datum; + indexCreate(key: any): Datum; + // indexCreate(name: Value, indexFunction: (doc: Datum) => Value): Datum; + indexCreate(key: any): Datum { + return expr(createQuery(async () => { + const tableName = await resolveValue(this.tableName); + await this.db.exec(`CREATE INDEX ${JSON.stringify(tableName + '_' + key)} ON ${JSON.stringify(tableName)}(${JSON.stringify(key)})`); + return { created: 1 } as IndexChangeResult; + })); + } + + indexDrop(key: U): Datum; + // indexDrop(name: Value): Datum; + indexDrop(key: any): Datum; + indexDrop(key: any): Datum { + return expr(createQuery(async () => { + const tableName = await resolveValue(this.tableName); + await this.db.exec(`DROP INDEX ${JSON.stringify(tableName + '_' + key)}`); + return { dropped: 1 } as IndexChangeResult; + })); + } + + indexList(): Datum { + return expr(createQuery(async () => { + const tableName = await resolveValue(this.tableName); + const rows = await this.db.all<{ name: string }>( + `SELECT name FROM sqlite_master WHERE type="index" AND tbl_name=${JSON.stringify(tableName)}`); + return rows.map(row => row.name.startsWith(tableName) ? row.name.slice(tableName.length + 1) : row.name); + })); + } + async run(): Promise { const tableName = await resolveValue(this.tableName); if(this.sel || this.query.length) { diff --git a/src/test.ts b/src/test.ts index 06cab71..3226080 100644 --- a/src/test.ts +++ b/src/test.ts @@ -29,6 +29,7 @@ async function test(create: () => Promise, log?: string) { const db = await create(); const console = { log: (a, ...b) => logger.info(a, ...b) }; + let errored = false; // begin sample try { @@ -85,8 +86,15 @@ async function test(create: () => Promise, log?: string) { logger.info('testTbl.filter(doc => doc("key").len().ge(4)): ', await testTbl.filter(doc => doc('key').len().ge(4)).run()); logger.info('testTbl.get("foo")("count").do(v => v.add(1)).gt(4).branch("yes", () => "no"))', await testTbl.get('foo')('count').do(v => v.add(1)).gt(4).branch('yes', () => 'no').run()); + + logger.info('testTbl.indexList(): ', await testTbl.indexList().run()); + logger.info('testTbl.indexCreate("value"): ', await testTbl.indexCreate('value').run()); + logger.info('testTbl.indexList(): ', await testTbl.indexList().run()); + logger.info('testTbl.indexDrop("value"): ', await testTbl.indexDrop('value').run()); + logger.info('testTbl.indexList(): ', await testTbl.indexList().run()); } catch(e) { logger.error(e); + errored = true; } // cleanup! @@ -100,18 +108,23 @@ async function test(create: () => Promise, log?: string) { if(list.includes('__reql_typemap__')) await db.tableDrop('__reql_typemap__').run().catch(e => logger.error(e)); - return db.close(); + await db.close(); + return errored; } const rootLog = getLogger('root'); (async () => { + const errored = []; for(const [create, log] of [ [() => createPostgresDatabase({ client: new Client({ user: 'bobtest', password: 'keyboardcat', database: 'test' }) }), 'pg'], [createSQLite3Database, 'sqlite3'], ] as [() => Promise, string][]) { - await test(create, log).catch(e => rootLog.error(e)); + if(await test(create, log).catch(e => { rootLog.error(e); return true; })) + errored.push(log); } + for(const db of errored) + rootLog.error(db + ' test failed!'); })().then(() => { process.exit(0); }).catch(e => {