New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

db-auto

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-auto - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

5

dist/src/cli.js

@@ -22,5 +22,7 @@ "use strict";

.argument('[id]', "the id of the primary key in the first table in the path")
.option('-p, --plan', "show the plan", false)
// .allowUnknownOption ( true )
.version(version)
.action((path, id, options) => {
const errorsOrresult = (0, path_1.processPathString)(config.tables, path, id);
const errorsOrresult = (0, path_1.processPathString)(config.tables, path, id, options, options.plan);
if ((0, utils_1.hasErrors)(errorsOrresult)) {

@@ -32,2 +34,3 @@ (0, utils_1.reportErrors)(errorsOrresult);

});
(0, tables_1.findQueryParams)(config.tables).forEach(param => program.option('--' + param.name + " <" + param.name + ">", param.description));
const mock = program

@@ -34,0 +37,0 @@ .command('mocks')

@@ -61,1 +61,13 @@ "use strict";

});
describe('db-auto path --help', () => {
it("should include the queries as options", () => __awaiter(void 0, void 0, void 0, function* () {
const expected = (0, files_1.readTestFile)(mockTestDir, 'help.expected.txt');
expect(yield (0, integration_fixture_1.executeDbAuto)(mockTestDir, `--help`)).toEqual(expected);
}));
});
describe('db-auto path --options that are query params', () => {
it("should db-auto driver --name fred", () => __awaiter(void 0, void 0, void 0, function* () {
const expected = (0, files_1.readTestFile)(mockTestDir, 'pathWithQueryParams.driver.name.fred.expected.txt');
expect(yield (0, integration_fixture_1.executeDbAuto)(mockTestDir, `driver --name fred`)).toEqual(expected);
}));
});

2

dist/src/path.d.ts

@@ -16,4 +16,4 @@ import { ErrorsAnd, NameAnd } from "@db-auto/utils";

type PP = SelectDataPP | LinksPP | SqlPP;
export declare function processPathString(tables: NameAnd<CleanTable>, path: string, id: string | undefined, showPlan?: boolean): ErrorsAnd<PP>;
export declare function processPathString(tables: NameAnd<CleanTable>, path: string, id: string | undefined, queryParams: NameAnd<string>, showPlan?: boolean): ErrorsAnd<PP>;
export declare function prettyPrintPP(pp: PP): string[];
export {};

@@ -16,3 +16,3 @@ "use strict";

}
function processPathString(tables, path, id, showPlan) {
function processPathString(tables, path, id, queryParams, showPlan) {
const parts = path.split('.');

@@ -24,3 +24,3 @@ if (parts.length === 0)

return processQueryPP(tables, parts);
let plan = (0, tables_1.buildPlan)(tables_1.clean, parts, id);
let plan = (0, tables_1.buildPlan)(tables_1.clean, parts, id, queryParams);
if ((0, utils_1.hasErrors)(plan))

@@ -27,0 +27,0 @@ return plan;

{
"name": "db-auto",
"description": "",
"version": "0.0.11",
"version": "0.0.12",
"main": "dist/index",

@@ -24,9 +24,9 @@ "types": "dist/index",

"commander": "^10.0.0",
"@db-auto/oracle": "0.0.11",
"@db-auto/mysql": "0.0.11",
"@db-auto/tables": "0.0.11",
"@db-auto/utils": "0.0.11",
"@db-auto/files": "0.0.11",
"@db-auto/mocks": "0.0.11",
"@db-auto/environments": "0.0.11"
"@db-auto/oracle": "0.0.12",
"@db-auto/mysql": "0.0.12",
"@db-auto/tables": "0.0.12",
"@db-auto/utils": "0.0.12",
"@db-auto/files": "0.0.12",
"@db-auto/mocks": "0.0.12",
"@db-auto/environments": "0.0.12"
},

@@ -33,0 +33,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc