refactor: migrate messageStore to drizzle-orm
- Replace all raw SQL queries in messageStore.ts with Drizzle ORM queries - Remove DatabaseAdapter dependency from messageStore functions - Update all function signatures to be async and remove db parameter - Functions now use getDatabase() internally for database access - Update all call sites in messageCapture.ts, attachmentUploader.ts, aiAnalyzer.ts, webserver.ts, and index.ts - All functions remain backward compatible in behavior - TypeScript typecheck passes with no errors - All tests pass (11 passed)
This commit is contained in:
+2
-3
@@ -285,8 +285,7 @@ export async function startWebserver(
|
||||
const offsetNum = parseInt(offset) || 0;
|
||||
|
||||
if (type === "image") {
|
||||
const attachments = getAttachmentsByChannel(
|
||||
db,
|
||||
const attachments = await getAttachmentsByChannel(
|
||||
channel,
|
||||
limitNum,
|
||||
offsetNum,
|
||||
@@ -297,7 +296,7 @@ export async function startWebserver(
|
||||
count: attachments.length,
|
||||
});
|
||||
} else {
|
||||
const messages = getMessagesByChannel(db, channel, limitNum, offsetNum);
|
||||
const messages = await getMessagesByChannel(channel, limitNum, offsetNum);
|
||||
res.json({
|
||||
type: "text",
|
||||
data: messages,
|
||||
|
||||
Reference in New Issue
Block a user