Huakun Shen e9e814b23f
Update drizzle-orm to version 0.41.0 and implement clipboard cleanup functionality
- Updated drizzle-orm dependency in package.json and pnpm-lock.yaml to version 0.41.0.
- Added a new utility function `cleanClipboard` to remove clipboard entries older than 10 days.
- Integrated clipboard cleanup into the initialization process, logging success or failure.
- Refactored drizzle exports to include `proxyDB` for better access to the database proxy.
- Minor cleanup in the proxy.ts file to remove commented-out debug logs.
2025-04-03 10:56:35 -04:00
..
2025-04-01 06:15:10 -04:00
2025-04-01 06:15:10 -04:00
2025-04-01 06:15:10 -04:00
2025-04-01 06:15:10 -04:00
2025-04-01 06:15:10 -04:00

drizzle

  • Only use pull to generate the schema from existing database.
  • Don't migrate or push.
export DB_FILE_NAME="~/Library/Application Support/sh.kunkun.desktop/kk.dev.sqlite"
bunx drizzle-kit pull

We are using sqlite with fts5, which drizzle doesn't support yet, so pushing the schema will destroy the existing schema.

We only use pulled schema to generate sql queries.

Update Schema

After drizzle-kit pull the schema may have problem with JSON type and boolean type.

Will need to manually update the following

JSON

+ data: text({ mode: "json" }).notNull(),
+ metadata: text({ mode: "json" }),
- data: numeric().notNull(),
- metadata: numeric(),

Boolean

+ enabled: integer({ mode: "boolean" }),
- enabled: numeric().default(sql`(TRUE)`),