koishi-plugin-database-csvdb provides a lightweight, file-based database service for the Koishi chatbot framework, leveraging CSV files for data storage. Currently at version 1.2.0, this plugin offers a simple, no-additional-dependency solution for persistent storage within Koishi applications. Its primary differentiators are its ease of use, the universal compatibility of the CSV format (allowing direct editing with spreadsheet software like Excel), and its built-in concurrency safety achieved through file locking mechanisms. This makes it suitable for smaller to medium-scale Koishi bots where a full-fledged relational or NoSQL database might be overkill. Release cadence is tied to bug fixes and feature enhancements, typically following the Koishi core framework's evolution. It's an ideal choice for developers seeking minimal overhead and direct data accessibility.
npm install koishi-plugin-database-csvdbVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize a Koishi application and register the `koishi-plugin-database-csvdb` plugin with a custom data path, then interact with the database using a simple command.
For applications requiring extremely high throughput or storing millions of records, consider migrating to more robust database plugins like `koishi-plugin-database-mysql` or `koishi-plugin-database-sqlite`.
Ensure the directory specified by `path` exists and that the user running the Koishi application has read and write permissions to it. For example, `mkdir -p data/csv_database && chmod 700 data/csv_database`.
Only edit CSV files when the Koishi application is stopped to avoid conflicts with file locks. Strictly adhere to CSV formatting rules (e.g., proper escaping of commas, newlines). Backup your `path` directory regularly before manual modifications.
Upgrade your Koishi core framework to version `^4.17.1` or higher to ensure compatibility. Check the `peerDependencies` in `package.json` for precise version requirements.
Create the directory specified by `path` (e.g., `mkdir -p data/csv_database`) and ensure the Koishi process has appropriate read/write permissions.
Verify that `app.plugin(apply, config)` is called correctly during Koishi initialization and that no preceding errors prevented the plugin from successfully loading and registering its services.
Ensure the Koishi process has full read/write permissions to the `path` directory and its contents. Check if another instance of Koishi or another application is accessing the same database files simultaneously and close the conflicting process.