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.17 to 0.0.18

8

dist/src/cli.js

@@ -34,2 +34,3 @@ "use strict";

.option('-s, --sql', "show the sql instead of executing", false)
.option('-t, --trace', "trace the results", false)
.option('-w, --where [where...]', "a where clause added to the query. There is no syntax checking", [])

@@ -40,3 +41,8 @@ // .allowUnknownOption ( true )

const where = options.where ? options.where : [];
const errorsOrresult = (0, path_1.processPathString)(config.tables, (0, tables_1.makePathSpec)(path, id, options, where), options);
let pathSpec = (0, tables_1.makePathSpec)(path, id, options, where);
if (options.trace) {
(0, path_1.tracePlan)(config.tables, pathSpec, options).forEach(line => console.log(line));
return;
}
const errorsOrresult = (0, path_1.processPathString)(config.tables, pathSpec, options);
if ((0, utils_1.hasErrors)(errorsOrresult)) {

@@ -43,0 +49,0 @@ (0, utils_1.reportErrors)(errorsOrresult);

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

export declare function prettyPrintPP(pp: PP): string[];
export declare function makeTracePlanSpecs(pathSpec: PathSpec): PathSpec[];
export declare function tracePlan(tables: NameAnd<CleanTable>, pathSpec: PathSpec, options: ProcessPathOptions): string[];
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prettyPrintPP = exports.processPathString = void 0;
exports.tracePlan = exports.makeTracePlanSpecs = exports.prettyPrintPP = exports.processPathString = void 0;
const utils_1 = require("@db-auto/utils");

@@ -48,1 +48,22 @@ const tables_1 = require("@db-auto/tables");

exports.prettyPrintPP = prettyPrintPP;
function makeTracePlanSpecs(pathSpec) {
const path = pathSpec.path;
const result = [];
for (let i = 0; i < path.length; i++) {
result.push(Object.assign(Object.assign({}, pathSpec), { path: path.slice(0, i + 1) }));
}
return result;
}
exports.makeTracePlanSpecs = makeTracePlanSpecs;
function tracePlan(tables, pathSpec, options) {
const result = [];
const specs = makeTracePlanSpecs(pathSpec);
for (let i = 0; i < specs.length; i++) {
const pp = processPathString(tables, specs[i], options);
if ((0, utils_1.hasErrors)(pp))
return pp;
result.push(pp);
}
return (0, utils_1.flatMap)(result, (pp, i) => [`${specs[i].path}`, ...prettyPrintPP(pp), '']);
}
exports.tracePlan = tracePlan;

18

package.json
{
"name": "db-auto",
"description": "",
"version": "0.0.17",
"version": "0.0.18",
"main": "dist/index",

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

"commander": "^10.0.0",
"@db-auto/oracle": "0.0.17",
"@db-auto/mysql": "0.0.17",
"@db-auto/postgres": "0.0.17",
"@db-auto/tables": "0.0.17",
"@db-auto/utils": "0.0.17",
"@db-auto/files": "0.0.17",
"@db-auto/mocks": "0.0.17",
"@db-auto/environments": "0.0.17"
"@db-auto/oracle": "0.0.18",
"@db-auto/mysql": "0.0.18",
"@db-auto/postgres": "0.0.18",
"@db-auto/tables": "0.0.18",
"@db-auto/utils": "0.0.18",
"@db-auto/files": "0.0.18",
"@db-auto/mocks": "0.0.18",
"@db-auto/environments": "0.0.18"
},

@@ -34,0 +34,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