mirror of
https://github.com/zadam/trilium.git
synced 2025-12-04 22:44:25 +01:00
fix(search): get rid of exporting dbConnection
This commit is contained in:
parent
b8aa7402d8
commit
942647ab9c
@ -389,10 +389,6 @@ function disableSlowQueryLogging<T>(cb: () => T) {
|
||||
}
|
||||
}
|
||||
|
||||
function getDbConnection(): DatabaseType {
|
||||
return dbConnection;
|
||||
}
|
||||
|
||||
export default {
|
||||
insert,
|
||||
replace,
|
||||
@ -460,6 +456,5 @@ export default {
|
||||
fillParamList,
|
||||
copyDatabase,
|
||||
disableSlowQueryLogging,
|
||||
rebuildIntegrationTestDatabase,
|
||||
getDbConnection
|
||||
rebuildIntegrationTestDatabase
|
||||
};
|
||||
|
||||
@ -67,20 +67,8 @@ async function initDbConnection() {
|
||||
PRIMARY KEY (tmpID)
|
||||
);`)
|
||||
|
||||
// Register SQLite search functions after database is ready
|
||||
try {
|
||||
const { getSqliteFunctionsService } = await import("./search/sqlite_functions.js");
|
||||
const functionsService = getSqliteFunctionsService();
|
||||
const db = sql.getDbConnection();
|
||||
|
||||
if (functionsService.registerFunctions(db)) {
|
||||
log.info("SQLite search functions registered successfully");
|
||||
} else {
|
||||
log.info("SQLite search functions registration skipped (already registered)");
|
||||
}
|
||||
} catch (error) {
|
||||
log.error(`Failed to register SQLite search functions: ${error}`);
|
||||
}
|
||||
// Note: SQLite search functions are now initialized directly in sql.ts
|
||||
// This ensures they're available before any queries run
|
||||
|
||||
dbReady.resolve();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user