Socket
Socket
Sign inDemoInstall

knex-schema-inspector

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knex-schema-inspector - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

18

dist/dialects/mysql.js

@@ -117,10 +117,14 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var count;
var result;
return __generator(this, function (_a) {
count = this.knex
.count({ count: '*' })
.from('information_schema.tables')
.where({ table_schema: this.knex.client.database(), table_name: table })
.first().count;
return [2 /*return*/, !!count];
switch (_a.label) {
case 0: return [4 /*yield*/, this.knex
.count({ count: '*' })
.from('information_schema.tables')
.where({ table_schema: this.knex.client.database(), table_name: table })
.first()];
case 1:
result = _a.sent();
return [2 /*return*/, (result && result.count === 1) || false];
}
});

@@ -127,0 +131,0 @@ });

@@ -112,3 +112,3 @@ import Knex from 'knex';

async hasTable(table: string): Promise<boolean> {
const { count } = this.knex
const result = await this.knex
.count<{ count: 0 | 1 }>({ count: '*' })

@@ -118,3 +118,3 @@ .from('information_schema.tables')

.first();
return !!count;
return (result && result.count === 1) || false;
}

@@ -121,0 +121,0 @@

{
"name": "knex-schema-inspector",
"version": "0.0.7",
"version": "0.0.8",
"description": "[WIP] Utility for extracting information about existing DB schema",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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