analysis-tools
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
declare type DatabaseScheme = 'mysql'; | ||
declare type DatabaseScheme = 'mysql' | 'postgresql'; | ||
export interface Database { | ||
@@ -3,0 +3,0 @@ scheme: DatabaseScheme; |
@@ -40,3 +40,4 @@ "use strict"; | ||
exports.SQLDatabase = void 0; | ||
var MySQLDatabase_1 = require("./driver/MySQLDatabase"); | ||
var MySQL_1 = require("./driver/MySQL"); | ||
var Postgres_1 = require("./driver/Postgres"); | ||
var SQLDatabase = /** @class */ (function () { | ||
@@ -47,4 +48,12 @@ function SQLDatabase(endpoint) { | ||
this.scheme = 'mysql'; | ||
this.driver = new MySQLDatabase_1.MySQLDatabase(endpoint); | ||
this.driver = new MySQL_1.MySQLDatabase(endpoint); | ||
return; | ||
} | ||
if (this.endpoint.startsWith('postgresql://') || | ||
this.endpoint.startsWith('postgres://')) { | ||
this.scheme = 'postgresql'; | ||
this.driver = new Postgres_1.PostgresDatabase(endpoint); | ||
return; | ||
} | ||
throw new Error('Error in SQLDatabase: unknown database scheme'); | ||
} | ||
@@ -51,0 +60,0 @@ SQLDatabase.prototype.init = function () { |
{ | ||
"name": "analysis-tools", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"connection-string-parser": "^1.0.3", | ||
"mysql2": "^2.1.0" | ||
"connection-string-parser": "1.0.3", | ||
"mysql2": "2.1.0", | ||
"pg": "8.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/mysql2": "types/mysql2", | ||
"@types/node": "^14.0.13", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.9.5" | ||
"@types/node": "14.0.13", | ||
"@types/pg": "^7.14.3", | ||
"ts-node": "8.10.2", | ||
"typescript": "3.9.5" | ||
}, | ||
@@ -19,4 +21,4 @@ "scripts": { | ||
"build": "tsc -d", | ||
"prepublish": "rm -rf dist/ && yarn build" | ||
"prepublishOnly": "rm -rf dist/ && yarn build" | ||
} | ||
} |
@@ -1,4 +0,5 @@ | ||
import { MySQLDatabase } from './driver/MySQLDatabase' | ||
import { MySQLDatabase } from './driver/MySQL' | ||
import { PostgresDatabase } from './driver/Postgres' | ||
type DatabaseScheme = 'mysql' | ||
type DatabaseScheme = 'mysql' | 'postgresql' | ||
export interface Database { | ||
@@ -18,3 +19,3 @@ scheme: DatabaseScheme | ||
private driver: MySQLDatabase | ||
private driver: MySQLDatabase | PostgresDatabase | ||
@@ -27,3 +28,13 @@ constructor(endpoint) { | ||
this.driver = new MySQLDatabase(endpoint) | ||
return | ||
} | ||
if ( | ||
this.endpoint.startsWith('postgresql://') || | ||
this.endpoint.startsWith('postgres://') | ||
) { | ||
this.scheme = 'postgresql' | ||
this.driver = new PostgresDatabase(endpoint) | ||
return | ||
} | ||
throw new Error('Error in SQLDatabase: unknown database scheme') | ||
} | ||
@@ -30,0 +41,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33597
23
831
3
5
+ Addedpg@8.2.1
+ Addedansicolors@0.3.2(transitive)
+ Addedbuffer-writer@2.0.0(transitive)
+ Addedcardinal@2.1.1(transitive)
+ Addedconnection-string-parser@1.0.3(transitive)
+ Addeddenque@1.5.1(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addediconv-lite@0.5.2(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedmysql2@2.1.0(transitive)
+ Addedpacket-reader@1.0.0(transitive)
+ Addedpg@8.2.1(transitive)
+ Addedpg-connection-string@2.7.0(transitive)
+ Addedpg-int8@1.0.1(transitive)
+ Addedpg-pool@3.7.0(transitive)
+ Addedpg-protocol@1.7.0(transitive)
+ Addedpg-types@2.2.0(transitive)
+ Addedpgpass@1.0.5(transitive)
+ Addedpostgres-array@2.0.0(transitive)
+ Addedpostgres-bytea@1.0.0(transitive)
+ Addedpostgres-date@1.0.7(transitive)
+ Addedpostgres-interval@1.2.0(transitive)
+ Addedredeyed@2.1.1(transitive)
+ Addedsemver@4.3.2(transitive)
+ Addedsplit2@4.2.0(transitive)
+ Addedtslib@1.14.1(transitive)
+ Addedxtend@4.0.2(transitive)
+ Addedyallist@3.1.1(transitive)
- Removedconnection-string-parser@1.0.4(transitive)
- Removeddenque@2.1.0(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removedmysql2@2.3.3(transitive)
- Removedtslib@2.8.1(transitive)
- Removedyallist@4.0.0(transitive)
Updatedmysql2@2.1.0