fix: lazily import sharp to fix commonjs error

This commit is contained in:
Max Richter
2026-01-10 20:13:15 +01:00
parent c74a19b527
commit 47d32d68c7
18 changed files with 145 additions and 68 deletions

View File

@@ -12,7 +12,9 @@ export const userTable = sqliteTable("user", {
id: text()
.primaryKey(),
createdAt: integer("created_at", { mode: "timestamp" })
.default(sql`(current_timestamp)`)
.default(sql`
(CURRENT_TIMESTAMP)
`)
.notNull(),
email: text()
.notNull(),
@@ -24,7 +26,9 @@ export const sessionTable = sqliteTable("session", {
id: text("id")
.primaryKey(),
createdAt: integer("created_at", { mode: "timestamp_ms" }).default(
sql`(current_timestamp)`,
sql`
(CURRENT_TIMESTAMP)
`,
),
expiresAt: integer("expires_at", { mode: "timestamp" })
.notNull(),
@@ -38,12 +42,16 @@ export const performanceTable = sqliteTable("performance", {
time: int().notNull(),
createdAt: integer("created_at", {
mode: "timestamp_ms",
}).default(sql`(STRFTIME('%s', 'now') * 1000)`),
}).default(sql`
(STRFTIME('%s', 'now') * 1000)
`),
});
export const imageTable = sqliteTable("image", {
createdAt: integer("created_at", { mode: "timestamp" }).default(
sql`(unixepoch())`,
sql`
(unixepoch())
`,
),
url: text().notNull(),
average: text().notNull(),
@@ -70,7 +78,9 @@ export const cacheTable = sqliteTable("cache", {
json: text({ mode: "json" }),
binary: blob(),
createdAt: integer("created_at", { mode: "timestamp" }).default(
sql`(current_timestamp)`,
sql`
(CURRENT_TIMESTAMP)
`,
),
expiresAt: integer("expires_at", { mode: "timestamp" }),
}, (table) => {