mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-09 01:02:18 +02:00
DEBUG: verbose sqlite
This commit is contained in:
parent
8b1a4f72fa
commit
884edcc301
|
@ -74,6 +74,7 @@ class SqliteMessageStorage implements ISqliteMessageStorage {
|
||||||
this.isEnabled = true;
|
this.isEnabled = true;
|
||||||
|
|
||||||
this.database = new sqlite3.Database(sqlitePath);
|
this.database = new sqlite3.Database(sqlitePath);
|
||||||
|
this.database.on("trace", (sql) => log.debug(`sql-${this.stmt_id()} ${sql}`));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.run_migrations();
|
await this.run_migrations();
|
||||||
|
@ -274,6 +275,11 @@ class SqliteMessageStorage implements ISqliteMessageStorage {
|
||||||
return this.isEnabled;
|
return this.isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _stmt_id = 0;
|
||||||
|
private stmt_id(): string {
|
||||||
|
return (this._stmt_id++).toString();
|
||||||
|
}
|
||||||
|
|
||||||
private serialize_run(stmt: string, params: any[]): Promise<void> {
|
private serialize_run(stmt: string, params: any[]): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.database.serialize(() => {
|
this.database.serialize(() => {
|
||||||
|
|
Loading…
Reference in a new issue