Switch to vercel's biome setup (#543)

This commit is contained in:
Jared Palmer 2024-11-15 13:00:15 -05:00 committed by GitHub
parent b8643353c0
commit 43aa1c6e58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 414 additions and 201 deletions

View file

@ -20,6 +20,8 @@ import {
// Optionally, if not using email/pass login, you can
// use the Drizzle adapter for Auth.js / NextAuth
// https://authjs.dev/reference/adapter/drizzle
// biome-ignore lint: Forbidden non-null assertion.
const client = postgres(`${process.env.POSTGRES_URL!}?sslmode=require`);
const db = drizzle(client);
@ -232,8 +234,8 @@ export async function deleteDocumentsByIdAfterTimestamp({
.where(
and(
eq(suggestion.documentId, id),
gt(suggestion.documentCreatedAt, timestamp)
)
gt(suggestion.documentCreatedAt, timestamp),
),
);
return await db
@ -241,7 +243,7 @@ export async function deleteDocumentsByIdAfterTimestamp({
.where(and(eq(document.id, id), gt(document.createdAt, timestamp)));
} catch (error) {
console.error(
'Failed to delete documents by id after timestamp from database'
'Failed to delete documents by id after timestamp from database',
);
throw error;
}
@ -272,7 +274,7 @@ export async function getSuggestionsByDocumentId({
.where(and(eq(suggestion.documentId, documentId)));
} catch (error) {
console.error(
'Failed to get suggestions by document version from database'
'Failed to get suggestions by document version from database',
);
throw error;
}

View file

@ -57,7 +57,7 @@ export const vote = pgTable(
return {
pk: primaryKey({ columns: [table.chatId, table.messageId] }),
};
}
},
);
export type Vote = InferSelectModel<typeof vote>;
@ -77,7 +77,7 @@ export const document = pgTable(
return {
pk: primaryKey({ columns: [table.id, table.createdAt] }),
};
}
},
);
export type Document = InferSelectModel<typeof document>;
@ -103,7 +103,7 @@ export const suggestion = pgTable(
columns: [table.documentId, table.documentCreatedAt],
foreignColumns: [document.id, document.createdAt],
}),
})
}),
);
export type Suggestion = InferSelectModel<typeof suggestion>;