slite-change
Advanced tools
Comparing version 1.2.15 to 1.2.16
declare let sqlite: any; | ||
declare type ProcStack = { | ||
type ProcStack = { | ||
procName: string; | ||
@@ -4,0 +4,0 @@ procFunc: (args: string) => void; |
@@ -15,2 +15,14 @@ "use strict"; | ||
class SliteChange { | ||
Fs; | ||
Sql; | ||
ChangeLog; | ||
ChangeLogDir; | ||
LastCompletedChangeId; | ||
ErrorMessage; | ||
ErrorFile; | ||
ChangesIssued; | ||
ChangesCompleted; | ||
callStack; | ||
sourceFiles; | ||
ProcCallStack; | ||
constructor(Sql, ChangeLog, Callback, ProcCallStack) { | ||
@@ -175,3 +187,3 @@ this.ChangeLog = ChangeLog; | ||
else { | ||
// This the all done callback | ||
// This is the all done callback | ||
Callback(this.ErrorMessage); | ||
@@ -209,3 +221,3 @@ } | ||
this.Sql.get("SELECT IIF(MAX(changeID) == 0, 0, MAX(changeID)) AS id FROM CHANGELOG;", (err, row) => { | ||
if ((err === null || err === void 0 ? void 0 : err.message.length) > 0) { | ||
if (err?.message.length > 0) { | ||
this.SetError(err.message, Callback); | ||
@@ -212,0 +224,0 @@ } |
{ | ||
"name": "slite-change", | ||
"version": "1.2.15", | ||
"version": "1.2.16", | ||
"description": "A simple change management system for SQLite3 written in pure JavaScript/TypeScript.", | ||
@@ -36,12 +36,12 @@ "main": "dist/slite-change.js", | ||
"dependencies": { | ||
"date-and-time": "^2.0.1", | ||
"date-and-time": "^3.0.2", | ||
"fs": "^0.0.1-security", | ||
"md5": "^2.3.0", | ||
"process": "^0.11.10", | ||
"sqlite3": "^5.0.2" | ||
"sqlite3": "^5.1.6" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^16.11.11" | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^20.5.0" | ||
} | ||
} |
@@ -220,3 +220,3 @@ # slite-change | ||
``` | ||
npm run tests | ||
npm run test | ||
@@ -223,0 +223,0 @@ # Or as defined in package.json |
@@ -24,3 +24,3 @@ "use strict"; | ||
/** | ||
* While creating a moder Angular web service to run on Raspberry Pi, a DB change control was needed. | ||
* While creating a modern Angular web service to run on Raspberry Pi, a DB change control was needed. | ||
* Liquibase is great and it was consided for use but in a small system were Sqlite is used, | ||
@@ -210,3 +210,3 @@ * having a large Java application just to manage simple changes may not be practical. | ||
} else { | ||
// This the all done callback | ||
// This is the all done callback | ||
Callback(this.ErrorMessage); | ||
@@ -213,0 +213,0 @@ } |
@@ -12,3 +12,3 @@ import { resolve } from "path/posix"; | ||
function ChangeSync(DbFile, DbChanges) { | ||
function ChangeSync(DbFile: string, DbChanges: string) { | ||
return new Promise((resolve, reject) => { | ||
@@ -21,3 +21,3 @@ // if (fs.existsSync(DbFile)) { | ||
}, 45); | ||
let Sql = new sqlite.Database(DbFile, (err) => { | ||
let Sql = new sqlite.Database(DbFile, (err: any) => { | ||
if (err) { | ||
@@ -43,7 +43,7 @@ console.error('Could not connect to database', err); | ||
console.log('Delete tempoary SQL') | ||
fs.unlinkSync('./db-changes/999-db-change.sql', (err) => {}); | ||
fs.unlinkSync('./db-changes/999-db-change.sql', (err: any) => {}); | ||
} | ||
if(fs.existsSync(DbFile)) { | ||
console.log('Delete %s', DbFile); | ||
fs.unlinkSync(DbFile, (err) => {}); | ||
fs.unlinkSync(DbFile, (err: any) => {}); | ||
} | ||
@@ -66,3 +66,3 @@ | ||
it('Should return a fail from SQL syntax error.', () => { | ||
fs.writeFileSync('./db-changes/999-db-change.sql', 'This file is going to fail', function(err) { | ||
fs.writeFileSync('./db-changes/999-db-change.sql', 'This file is going to fail', (err: any) => { | ||
if (err) { | ||
@@ -69,0 +69,0 @@ return console.error(err); |
{ | ||
"compilerOptions": { | ||
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | ||
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | ||
"module": "commonjs", /* Specify what module code is generated. */ | ||
@@ -5,0 +5,0 @@ "typeRoots": ["node_modules/@types"], /* Specify multiple folders that act like `./node_modules/@types`. */ |
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
54556
14
701
2
+ Addeddate-and-time@3.6.0(transitive)
- Removeddate-and-time@2.4.3(transitive)
Updateddate-and-time@^3.0.2
Updatedsqlite3@^5.1.6