mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-04 23:43:20 +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.database = new sqlite3.Database(sqlitePath);
|
||||
this.database.on("trace", (sql) => log.debug(`sql-${this.stmt_id()} ${sql}`));
|
||||
|
||||
try {
|
||||
await this.run_migrations();
|
||||
|
@ -274,6 +275,11 @@ class SqliteMessageStorage implements ISqliteMessageStorage {
|
|||
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> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.database.serialize(() => {
|
||||
|
|
Loading…
Reference in a new issue