Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #96 from qminer/frozen
Browse files Browse the repository at this point in the history
Frozen
  • Loading branch information
bergloman authored Feb 27, 2018
2 parents f332121 + 24c003f commit cc8e528
Show file tree
Hide file tree
Showing 12 changed files with 1,079 additions and 111 deletions.
37 changes: 36 additions & 1 deletion built/db_updater.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as qtopology from "qtopology";
/**
* Simple callback.
*/
Expand All @@ -10,6 +11,18 @@ export interface SimpleResultCallback<T> {
export interface Connection {
query(script: string, callback: SimpleResultCallback<any[]>): any;
}
/**
* Simple callback.
*/
export interface Glob {
sync(path: string): string[];
}
/**
* Simple callback.
*/
export interface Fs {
readFileSync(name: string, encoding: string): string;
}
/**
* Options for automatic DB upgrade
*/
Expand All @@ -18,6 +31,13 @@ export interface DbUpgraderOptions {
conn: Connection;
settings_table: string;
version_record_key: string;
log_prefix?: string;
glob?: Glob;
fs?: Fs;
use_init_script?: boolean;
init_script_name?: string;
sql_template_get?: string;
sql_template_update?: string;
}
/**
* This class handles automatic upgrades of underlaying database.
Expand All @@ -27,10 +47,25 @@ export declare class DbUpgrader {
private conn;
private settings_table;
private version_record_key;
private inner_glob;
private inner_fs;
private log_prefix;
private init_script_name;
private use_init_script;
private sql_template_update;
private sql_template_get;
private curr_version;
private files;
/** Simple constructor */
constructor(options: DbUpgraderOptions);
/** Internal logging utility method */
private log(s);
/** This method just checks if database version is in sync with code version. */
check(callback: qtopology.SimpleCallback): void;
/** Sequentially executes upgrade files. */
run(callback: any): void;
run(callback: qtopology.SimpleCallback): void;
private runInitScript(callback);
private getCurrentVersionFromDb(callback);
private checkFilesInScriptsDir(xcallback);
private updateVersionInDb(ver, callback);
}
150 changes: 100 additions & 50 deletions built/db_updater.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion built/db_updater.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cc8e528

Please sign in to comment.