Comparing version 0.0.23 to 0.0.24
@@ -44,2 +44,4 @@ "use strict"; | ||
.option('-t, --trace', "trace the results", false) | ||
.option('-j, --json', "Sql output as json instead of columns", false) | ||
.option('--onelinejson', "Sql output as 'one json per line for the row' instead of columns", false) | ||
.option('-w, --where [where...]', "a where clause added to the query. There is no syntax checking", []) | ||
@@ -62,3 +64,3 @@ // .allowUnknownOption ( true ) | ||
} | ||
(0, path_1.prettyPrintPP)(errorsOrresult).forEach(line => console.log(line)); | ||
(0, path_1.prettyPrintPP)(options, errorsOrresult).forEach(line => console.log(line)); | ||
})); | ||
@@ -65,0 +67,0 @@ (0, tables_1.findQueryParams)(config.tables).forEach(param => program.option('--' + param.name + " <" + param.name + ">", param.description)); |
@@ -67,2 +67,10 @@ "use strict"; | ||
})); | ||
it("should db-auto driver.mission with json output", () => __awaiter(void 0, void 0, void 0, function* () { | ||
const expected = (0, files_1.readTestFile)(mockTestDir, 'path.driver.mission.expected.json'); | ||
expect(yield (0, integration_fixture_1.executeDbAuto)(mockTestDir, `driver.mission --json`)).toEqual(expected); | ||
})); | ||
it("should db-auto driver.audit with oneline json output", () => __awaiter(void 0, void 0, void 0, function* () { | ||
const expected = (0, files_1.readTestFile)(mockTestDir, 'path.driver.audit.expected.oneline.json'); | ||
expect(yield (0, integration_fixture_1.executeDbAuto)(mockTestDir, `driver.audit --onelinejson`)).toEqual(expected); | ||
})); | ||
}); | ||
@@ -69,0 +77,0 @@ }); |
import { ErrorsAnd, NameAnd } from "@db-auto/utils"; | ||
import { CleanTable, PathSpec, SelectData } from "@db-auto/tables"; | ||
import { Environment } from "@db-auto/environments"; | ||
import { DalResult } from "@db-auto/dal"; | ||
import { DalResult, DalResultDisplayOptions } from "@db-auto/dal"; | ||
export interface SelectDataPP { | ||
@@ -22,3 +22,3 @@ type: 'selectData'; | ||
type PP = SelectDataPP | LinksPP | SqlPP | ResPP; | ||
interface ProcessPathOptions { | ||
interface ProcessPathOptions extends DalResultDisplayOptions { | ||
plan?: boolean; | ||
@@ -28,5 +28,5 @@ sql?: boolean; | ||
export declare function processPathString(env: Environment, tables: NameAnd<CleanTable>, pathSpec: PathSpec, options: ProcessPathOptions): Promise<ErrorsAnd<PP>>; | ||
export declare function prettyPrintPP(pp: PP): string[]; | ||
export declare function prettyPrintPP(options: DalResultDisplayOptions, pp: PP): string[]; | ||
export declare function makeTracePlanSpecs(pathSpec: PathSpec): PathSpec[]; | ||
export declare function tracePlan(env: Environment, tables: NameAnd<CleanTable>, pathSpec: PathSpec, options: ProcessPathOptions): Promise<string[]>; | ||
export {}; |
@@ -63,3 +63,3 @@ "use strict"; | ||
exports.processPathString = processPathString; | ||
function prettyPrintPP(pp) { | ||
function prettyPrintPP(options, pp) { | ||
if (pp.type === 'links') | ||
@@ -72,3 +72,3 @@ return ["Links:", ' ' + pp.links.join(', ')]; | ||
if (pp.type === 'res') | ||
return (0, dal_1.prettyPrintDalResult)(pp.res); | ||
return (0, dal_1.prettyPrintDalResult)(options, pp.res); | ||
throw new Error(`Unknown PP type\n${JSON.stringify(pp)}`); | ||
@@ -96,5 +96,5 @@ } | ||
} | ||
return (0, utils_1.flatMap)(result, (pp, i) => [`${specs[i].path.join('.')}`, ...prettyPrintPP(pp), '']); | ||
return (0, utils_1.flatMap)(result, (pp, i) => [`${specs[i].path.join('.')}`, ...prettyPrintPP(options, pp), '']); | ||
}); | ||
} | ||
exports.tracePlan = tracePlan; |
{ | ||
"name": "db-auto", | ||
"description": "", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"main": "dist/index", | ||
@@ -24,10 +24,10 @@ "types": "dist/index", | ||
"commander": "^10.0.0", | ||
"@db-auto/oracle": "0.0.23", | ||
"@db-auto/mysql": "0.0.23", | ||
"@db-auto/postgres": "0.0.23", | ||
"@db-auto/tables": "0.0.23", | ||
"@db-auto/utils": "0.0.23", | ||
"@db-auto/files": "0.0.23", | ||
"@db-auto/mocks": "0.0.23", | ||
"@db-auto/environments": "0.0.23" | ||
"@db-auto/oracle": "0.0.24", | ||
"@db-auto/mysql": "0.0.24", | ||
"@db-auto/postgres": "0.0.24", | ||
"@db-auto/tables": "0.0.24", | ||
"@db-auto/utils": "0.0.24", | ||
"@db-auto/files": "0.0.24", | ||
"@db-auto/mocks": "0.0.24", | ||
"@db-auto/environments": "0.0.24" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
41084
23
637
+ Added@db-auto/dal@0.0.24(transitive)
+ Added@db-auto/environments@0.0.24(transitive)
+ Added@db-auto/files@0.0.24(transitive)
+ Added@db-auto/mocks@0.0.24(transitive)
+ Added@db-auto/mysql@0.0.24(transitive)
+ Added@db-auto/oracle@0.0.24(transitive)
+ Added@db-auto/postgres@0.0.24(transitive)
+ Added@db-auto/tables@0.0.24(transitive)
+ Added@db-auto/utils@0.0.24(transitive)
- Removed@db-auto/dal@0.0.23(transitive)
- Removed@db-auto/environments@0.0.23(transitive)
- Removed@db-auto/files@0.0.23(transitive)
- Removed@db-auto/mocks@0.0.23(transitive)
- Removed@db-auto/mysql@0.0.23(transitive)
- Removed@db-auto/oracle@0.0.23(transitive)
- Removed@db-auto/postgres@0.0.23(transitive)
- Removed@db-auto/tables@0.0.23(transitive)
- Removed@db-auto/utils@0.0.23(transitive)
Updated@db-auto/environments@0.0.24
Updated@db-auto/files@0.0.24
Updated@db-auto/mocks@0.0.24
Updated@db-auto/mysql@0.0.24
Updated@db-auto/oracle@0.0.24
Updated@db-auto/postgres@0.0.24
Updated@db-auto/tables@0.0.24
Updated@db-auto/utils@0.0.24