2 Commits

Author SHA1 Message Date
Huakun
de3886d416
feat: implement clipboard data cleaning for data older than 10 days (#267)
* 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.

* Refactor clipboard cleanup logic to use configurable days parameter

- Introduced a variable `nDays` to allow dynamic adjustment of the clipboard cleanup threshold.
- Updated logging to reflect the configurable number of days for clipboard entry deletion instead of a hardcoded value.

* Enhance clipboard and database management in initialization process

- Added logging to `cleanClipboard` to indicate the number of clipboard entries older than a specified number of days.
- Introduced a new utility function `vacuumSqlite` for database maintenance, which is now called during app initialization.
- Updated the `init` function to await the completion of `cleanClipboard` and `vacuumSqlite` for better error handling and flow control.
- Ensured that the console attachment in `onMount` is awaited for proper synchronization.

* Update version in package.json from 0.1.37-beta.1 to 0.1.37

* Adds C11 standard flag for builds

Try to fix windows build beta CI
Adds the C11 standard flag to the build environment. This ensures
that the code is compiled using the C11 standard, potentially
improving compatibility and avoiding compiler-specific behavior.

* Remove CFLAGS for C11 standard from beta build workflow

This change eliminates the CFLAGS environment variable previously set for C11 standard compliance in the beta build process, streamlining the build configuration.
2025-04-03 12:42:27 -04:00
Huakun
bb9a46935c
Feature: add drizzle (#264)
* feat: add drizzle orm

* feat: update drizzle configuration and schema management

- Added a check for DB_FILE_NAME in drizzle.config.ts to ensure it's set.
- Updated package.json to change the package name to @kksh/drizzle and added exports for schema and relations.
- Enhanced README.md with instructions for using the schema generation.
- Refactored schema.ts for improved readability and organization of imports.

* add tauri-plugin-sql

* feat: add database select and execute commands

- Introduced `select` and `execute` functions in the database module to facilitate querying and executing SQL commands.
- Updated the Tauri plugin to expose these commands, allowing for database interactions from the frontend.
- Added corresponding permissions for the new commands in the permissions configuration.
- Enhanced the database library with JSON value handling for query parameters.

* fix: sqlite select command

* drizzle ORM verified working

* refactor: clean up database module by removing unused SelectQueryResult type and disabling eslint for explicit any usage

* pnpm lock update

* Update enum definition for type safety

- Changed enum to use 'as const' for better type inference
- Ensured more robust handling of extension publish sources

* reimplemented most db command functions with ORM (migrate from tauri command invoke

* fixed searchExtensionData orm function

* Refactor ORM commands and searchExtensionData function for improved readability and consistency

- Reformatted import statements for better organization.
- Cleaned up whitespace and indentation in searchExtensionData function.
- Enhanced readability of SQL conditions and query building logic.
- Disabled eslint for explicit any usage in the troubleshooters page.

* Fix test assertions in database module to use array indexing for results

format rust code

* update deno lock

* move drizzle from desktop to drizzle package

* update pnpm version and lock

* refactor: migrate db tauri commands to drizzle

* refactor: remove unused extension and command CRUD operations from db module
2025-04-01 06:15:10 -04:00