@dbpath/environments
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -137,6 +137,11 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (env.type === 'postgres') | ||
return (0, postgres_1.postgresDal)(env); | ||
if (env.type === 'oracle') | ||
return (0, oracle_1.oracleDal)(env); | ||
try { | ||
if (env.type === 'postgres') | ||
return yield (0, postgres_1.postgresDal)(env); | ||
if (env.type === 'oracle') | ||
return yield (0, oracle_1.oracleDal)(env); | ||
} | ||
catch (e) { | ||
return [`Could not get a dal for ${env.type}. Is it up? try 'dbpath admin status'`, e.message]; | ||
} | ||
throw new Error(`Unknown environment type ${env.type}. Currently on postgres is supported. ${JSON.stringify(env)}`); | ||
@@ -149,9 +154,14 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let dal = yield dalFor(env); | ||
if ((0, utils_1.hasErrors)(dal)) | ||
return false; | ||
try { | ||
const dialect = sqlDialect(env.type); | ||
yield dal.query(dialect.safeQuery); | ||
return true; | ||
let dal = yield dalFor(env); | ||
if ((0, utils_1.hasErrors)(dal)) | ||
return false; | ||
try { | ||
const dialect = sqlDialect(env.type); | ||
yield dal.query(dialect.safeQuery); | ||
return true; | ||
} | ||
finally { | ||
yield dal.close(); | ||
} | ||
} | ||
@@ -161,5 +171,2 @@ catch (e) { | ||
} | ||
finally { | ||
yield dal.close(); | ||
} | ||
}); | ||
@@ -166,0 +173,0 @@ } |
{ | ||
"name": "@dbpath/environments", | ||
"description": "", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"main": "dist/index", | ||
@@ -20,7 +20,7 @@ "types": "dist/index", | ||
"dependencies": { | ||
"@dbpath/utils": "0.3.5", | ||
"@dbpath/files": "0.3.5", | ||
"@dbpath/postgres": "0.3.5", | ||
"@dbpath/mysql": "0.3.5", | ||
"@dbpath/oracle": "0.3.5" | ||
"@dbpath/utils": "0.3.6", | ||
"@dbpath/files": "0.3.6", | ||
"@dbpath/postgres": "0.3.6", | ||
"@dbpath/mysql": "0.3.6", | ||
"@dbpath/oracle": "0.3.6" | ||
}, | ||
@@ -27,0 +27,0 @@ "devDependencies": { |
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
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
20433
360
+ Added@dbpath/config@0.3.6(transitive)
+ Added@dbpath/dal@0.3.6(transitive)
+ Added@dbpath/files@0.3.6(transitive)
+ Added@dbpath/fixtures@0.3.6(transitive)
+ Added@dbpath/mysql@0.3.6(transitive)
+ Added@dbpath/oracle@0.3.6(transitive)
+ Added@dbpath/postgres@0.3.6(transitive)
+ Added@dbpath/types@0.3.6(transitive)
+ Added@dbpath/utils@0.3.6(transitive)
- Removed@dbpath/config@0.3.5(transitive)
- Removed@dbpath/dal@0.3.5(transitive)
- Removed@dbpath/files@0.3.5(transitive)
- Removed@dbpath/fixtures@0.3.5(transitive)
- Removed@dbpath/mysql@0.3.5(transitive)
- Removed@dbpath/oracle@0.3.5(transitive)
- Removed@dbpath/postgres@0.3.5(transitive)
- Removed@dbpath/types@0.3.5(transitive)
- Removed@dbpath/utils@0.3.5(transitive)
Updated@dbpath/files@0.3.6
Updated@dbpath/mysql@0.3.6
Updated@dbpath/oracle@0.3.6
Updated@dbpath/postgres@0.3.6
Updated@dbpath/utils@0.3.6