koishi-plugin-database-inidb provides a lightweight database service for the Koishi chatbot framework. It stores all data in INI-formatted files, making the database easily inspectable and manually editable outside the application. Currently at stable version 1.2.0, this plugin aims for simplicity and ease of setup by having no external dependencies beyond Koishi itself. Its release cadence is typically event-driven, responding to Koishi framework updates or feature requests. A key differentiator is its file-based approach, which ensures portability and human readability, contrasted with traditional SQL or NoSQL databases. It also features file-locking mechanisms to maintain data consistency during concurrent access, which is crucial for a bot environment. This makes it suitable for smaller Koishi instances where a full-fledged database server is an overkill and resource usage is a primary concern.
npm install koishi-plugin-database-inidbVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up a Koishi application and integrating `koishi-plugin-database-inidb`. It includes an example of using the database service to store and retrieve user data via simple commands.
For applications requiring high throughput or managing extensive data, consider switching to a more performant database service like `koishi-plugin-database-sqlite` or `koishi-plugin-database-mongo`.
Always back up your database files (`path` directory) before manual modifications. Ensure INI syntax is strictly followed. It is generally recommended to interact with the database only through the Koishi application's API.
Ensure the configured `path` points to a secure, private directory with appropriate read/write permissions for the user running the Koishi application. Avoid placing database files in public web directories.
If your application requires rich data structures or sophisticated query logic, consider using a database plugin that supports SQL (e.g., SQLite, MySQL) or NoSQL (e.g., MongoDB) databases, which are better suited for these scenarios.
Ensure the directory specified in the `path` configuration (default: `data/database/inidb`) exists and the user running Koishi has full read/write access to it. You might need to adjust file permissions (`chmod`) or move the directory.
Verify that `koishi` is installed and meets the peer dependency version (`npm install koishi`). Check the plugin configuration passed to `app.plugin(plugin, config)` for any typos or invalid values. Inspect Koishi's console output for more specific error messages after this generic failure.
Examine the specified INI file for syntax errors (e.g., missing `[section]`, malformed `key=value` pairs). If the data is not critical or backed up, deleting the corrupted file might allow the plugin to regenerate it (though data will be lost for that table).