Comparing version 0.2.18 to 0.2.19
@@ -50,2 +50,3 @@ "use strict"; | ||
const init_1 = require("./init"); | ||
const dal_1 = require("@dbpath/dal"); | ||
exports.configFileName = 'dbpath.config.json'; | ||
@@ -104,7 +105,7 @@ function makeConfig(cwd, envVars) { | ||
const page = options.page ? parseInt(options.page) : 1; | ||
const fullOptions = Object.assign(Object.assign({}, options), { limitBy: dialect.limitFn, page }); | ||
const fullOptions = Object.assign(Object.assign({}, options), { limitBy: (0, dal_1.checkLimitOrThrow)(dialect.limitFn), page }); | ||
if (page < 1) | ||
throw new Error("Page must be greater than 0"); | ||
const where = fullOptions.where ? fullOptions.where : []; | ||
let pathSpec = (0, tables_1.makePathSpec)(path, meta.tables, id, fullOptions, where); | ||
let pathSpec = (0, tables_1.makePathSpec)(env.schema, path, meta.tables, id, fullOptions, where); | ||
if (fullOptions.trace) { | ||
@@ -111,0 +112,0 @@ const pps = yield (0, path_1.tracePlan)(envAndNameOrErrors, config.summary, meta, pathSpec, fullOptions); |
@@ -11,14 +11,6 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const integration_fixture_1 = require("./integration.fixture"); | ||
const path_1 = __importDefault(require("path")); | ||
const environments_1 = require("@dbpath/environments"); | ||
const files_1 = require("@dbpath/files"); | ||
const mockTestDir = integration_fixture_1.testRoot + '/empty'; | ||
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const p = (s) => path_1.default.join(mockTestDir, environments_1.dbPathDir, s); | ||
})); | ||
const expected = (0, files_1.readTestFile)(mockTestDir, 'expected.txt'); | ||
@@ -25,0 +17,0 @@ describe("the behaviour of dbpath when it is misconfigured", () => { |
@@ -243,1 +243,42 @@ "use strict"; | ||
}); | ||
describe("paging", () => { | ||
const asJson = (pageNum, pageSize, env) => __awaiter(void 0, void 0, void 0, function* () { | ||
let string = yield (0, integration_fixture_1.executeDbAuto)(mockTestDir, `driver --page ${pageNum} --pageSize ${pageSize} --json -e ${env}`); | ||
try { | ||
return JSON.parse(string); | ||
} | ||
catch (e) { | ||
console.log(string); | ||
console.error(e); | ||
throw e; | ||
} | ||
}); | ||
it("should page for postgres", () => __awaiter(void 0, void 0, void 0, function* () { | ||
expect(yield asJson(1, 1, "dev")).toEqual([ | ||
{ | ||
"driverid": 1, | ||
"name": "phil" | ||
} | ||
]); | ||
expect(yield asJson(2, 1, "dev")).toEqual([ | ||
{ | ||
"driverid": 2, | ||
"name": "joe" | ||
} | ||
]); | ||
})); | ||
it("should page for oracle", () => __awaiter(void 0, void 0, void 0, function* () { | ||
expect(yield asJson(1, 1, "oracle")).toEqual([ | ||
{ | ||
"driverid": 1, | ||
"name": "phil" | ||
} | ||
]); | ||
expect(yield asJson(2, 1, "oracle")).toEqual([ | ||
{ | ||
"driverid": 2, | ||
"name": "joe" | ||
} | ||
]); | ||
})); | ||
}); |
{ | ||
"name": "dbpath", | ||
"description": "", | ||
"version": "0.2.18", | ||
"version": "0.2.19", | ||
"main": "dist/index", | ||
@@ -24,7 +24,7 @@ "types": "dist/index", | ||
"commander": "^10.0.0", | ||
"@dbpath/tables": "0.2.18", | ||
"@dbpath/pathparser": "0.2.18", | ||
"@dbpath/utils": "0.2.18", | ||
"@dbpath/files": "0.2.18", | ||
"@dbpath/environments": "0.2.18" | ||
"@dbpath/tables": "0.2.19", | ||
"@dbpath/pathparser": "0.2.19", | ||
"@dbpath/utils": "0.2.19", | ||
"@dbpath/files": "0.2.19", | ||
"@dbpath/environments": "0.2.19" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64589
25
977
+ Added@dbpath/config@0.2.19(transitive)
+ Added@dbpath/dal@0.2.19(transitive)
+ Added@dbpath/environments@0.2.19(transitive)
+ Added@dbpath/files@0.2.19(transitive)
+ Added@dbpath/fixtures@0.2.19(transitive)
+ Added@dbpath/mysql@0.2.19(transitive)
+ Added@dbpath/oracle@0.2.19(transitive)
+ Added@dbpath/pathparser@0.2.19(transitive)
+ Added@dbpath/postgres@0.2.19(transitive)
+ Added@dbpath/tables@0.2.19(transitive)
+ Added@dbpath/types@0.2.19(transitive)
+ Added@dbpath/utils@0.2.19(transitive)
- Removed@dbpath/config@0.2.18(transitive)
- Removed@dbpath/dal@0.2.18(transitive)
- Removed@dbpath/environments@0.2.18(transitive)
- Removed@dbpath/files@0.2.18(transitive)
- Removed@dbpath/fixtures@0.2.18(transitive)
- Removed@dbpath/mysql@0.2.18(transitive)
- Removed@dbpath/oracle@0.2.18(transitive)
- Removed@dbpath/pathparser@0.2.18(transitive)
- Removed@dbpath/postgres@0.2.18(transitive)
- Removed@dbpath/tables@0.2.18(transitive)
- Removed@dbpath/types@0.2.18(transitive)
- Removed@dbpath/utils@0.2.18(transitive)
Updated@dbpath/environments@0.2.19
Updated@dbpath/files@0.2.19
Updated@dbpath/pathparser@0.2.19
Updated@dbpath/tables@0.2.19
Updated@dbpath/utils@0.2.19