Skip to content

Commit

Permalink
fix export type
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Aug 9, 2024
1 parent 1266d96 commit 04fd76b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/explorer/src/app/api/database.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Database from "better-sqlite3";
import sqlite from "better-sqlite3";
import fs from "fs";
import path from "path";

const DEFAULT_DB_PATH = "indexer.db";

export const getDatabase = () => {
export function getDatabase(): sqlite.Database | null {
let dbPath = process.env.INDEXER_DB_PATH_ABSOLUTE;
if (!dbPath) {
dbPath = path.join(
Expand All @@ -17,10 +17,10 @@ export const getDatabase = () => {
return null;
}

const db = new Database(dbPath);
const db = new sqlite(dbPath);
if (!db) {
return null;
}

return db;
};
}

0 comments on commit 04fd76b

Please sign in to comment.