Skip to content

[Feature Request] Official SQLite support for UserDB and cross-platform consistency #1162

@ruchid123123

Description

@ruchid123123

Problem Description

Currently, librime relies on LevelDB for user dictionaries. This leads to several issues:

  1. Sync Conflicts: LevelDB's multi-file structure is prone to corruption on cloud drives (Dropbox, iCloud, etc.).
  2. Ubuntu/Linux Integration Hurdles: Users attempting to use SQLite-based plugins (like librime-predict) or custom Lua-SQLite bindings on Ubuntu frequently encounter "failure to call SQLite" errors. These are often due to inconsistent linking, missing libsqlite3-dev dependencies in the default build scripts, or symbol conflicts when multiple plugins try to load SQLite differently.
  3. Data Opacity: LevelDB makes it difficult for users to inspect or fix their own data.

Proposed Solution

Introduce a first-class SqliteDb implementation within the core librime library.

  • Unified Dependency: By making SQLite an optional but officially supported backend, the build system (CMakeLists.txt) can consistently handle libsqlite3 detection and linking across Linux (Ubuntu), macOS, and Windows.
  • Stable Storage: Use a single-file .db schema for better sync compatibility.
  • Robustness: Solve the "call failure" issues on Ubuntu by providing a standard, tested path for SQLite integration.

Alternatives Considered

Maintaining separate SQLite logic in various plugins, which has proven to be unstable and difficult to configure on Linux systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions