fix: Admin consent logs - implement Export CSV, fix delete, switch to better-sqlite3

- Replace Astro DB with better-sqlite3 for reliable SQLite access
- Implement Export CSV feature in admin panel
- Fix delete consent function (make it global)
- Add better-sqlite3 dependency
This commit is contained in:
Kunthawat Greethong
2026-03-31 11:00:20 +07:00
parent ae4a897d11
commit cfd8bd196a
8 changed files with 501 additions and 45 deletions

View File

@@ -2,7 +2,7 @@ import { defineDb, defineTable, column } from 'astro:db';
export const ConsentLog = defineTable({
columns: {
id: column.number({ primaryKey: true }),
id: column.number({ primaryKey: true, autoIncrement: true }),
sessionId: column.text({ unique: true }),
timestamp: column.date(),
essential: column.boolean(),