Registry / web-framework / koishi-plugin-dataview

koishi-plugin-dataview

JSON →
library2.7.8jsnpmunverified

koishi-plugin-dataview is a plugin for the Koishi chatbot framework, providing a web-based console interface to view and interact with various database tables directly within the Koishi Console. It leverages Koishi's existing database connectivity to present data in a structured, browsable format, enhancing debugging and administrative capabilities. The current stable version is 2.7.8. Koishi plugins generally follow the release cadence of the Koishi core framework, with frequent updates to ensure compatibility and introduce new features. Its key differentiator is its seamless integration into the Koishi Console, offering a unified management experience for bot operations and underlying data, which is crucial for complex bot applications needing direct data inspection without external tools, simplifying bot administration and data inspection.

npm install koishi-plugin-dataview
INSTALL
IMPORT
SIG · KOISHI-PLUGIN-DATA
K
koishi-plugin-dataview
web-frameworkjavascriptv2.7.8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DataViewPlugin
import DataViewPlugin from 'koishi-plugin-dataview'
const DataViewPlugin = require('koishi-plugin-dataview')
The plugin is typically imported as a default export for use with `ctx.plugin()`.
DataViewPluginConfig
import type { Config as DataViewPluginConfig } from 'koishi-plugin-dataview'
Import the type for configuration schema if you need to define custom plugin options.
KoishiContextUse
ctx.plugin(DataViewPlugin, options)
new DataViewPlugin(ctx, options)
Koishi plugins are activated via `ctx.plugin()` rather than direct instantiation.

This quickstart demonstrates how to set up a minimal Koishi application, load the Koishi Console, and then integrate the DataView plugin to inspect database tables via the web interface. It uses an in-memory database for quick demonstration.

import { App, Schema } from 'koishi'; import { Console } from '@koishijs/plugin-console'; import DataViewPlugin from 'koishi-plugin-dataview'; const config = { port: 8080, host: 'localhost', logLevel: 'info', database: { // Use 'memory' for a quick demo. For production, configure a real database // like 'mysql', 'sqlite', or 'mongo' to see persistent data. protocol: 'memory' } }; const app = new App(config); // Koishi Console plugin is a peer dependency and must be loaded. app.plugin(Console); // Load the DataView plugin without specific options for default behavior. app.plugin(DataViewPlugin, { // Optional: configure specific tables to display or other plugin settings. // Example: maxRows: 100, // Limit number of rows per table displayed }); app.start().then(() => { console.log('Koishi application started successfully.'); console.log('Access the Koishi Console at http://localhost:8080/console'); console.log('DataView will be available under the "Data" tab in the console.'); }).catch(err => { console.error('Failed to start Koishi application:', err); });
Debug
Known issues
breakingMajor version updates of Koishi or its console plugin often require corresponding updates to koishi-plugin-dataview due to API changes. Always check the changelog when upgrading Koishi core.
fix
Ensure `koishi-plugin-dataview` version is compatible with your `koishi` and `@koishijs/plugin-console` versions. Refer to the plugin's `package.json` for peer dependency ranges.
affects: >=1.0
gotchaThe DataView plugin requires `@koishijs/plugin-console` to be installed and loaded in your Koishi application. Without the console, the DataView interface will not be accessible.
fix
Add `app.plugin(Console)` to your Koishi application initialization script before loading `DataViewPlugin` and ensure `@koishijs/plugin-console` is installed.
affects: >=1.0
gotchaDataView only displays data from the database configured for Koishi itself. If Koishi is not connected to a database, or is using an ephemeral in-memory database, DataView will show limited or temporary data.
fix
Configure Koishi with a persistent database protocol (e.g., `mysql`, `sqlite`, `mongo`) in your `App` configuration to view and manage your actual application data effectively.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module '@koishijs/plugin-console'
The peer dependency `@koishijs/plugin-console` is not installed.
fix
Run `npm install @koishijs/plugin-console` or `yarn add @koishijs/plugin-console`.
Error: Plugin koishi-plugin-dataview requires version X of koishi, but you have version Y.
Koishi core version mismatch with the plugin's peer dependency requirements.
fix
Upgrade or downgrade your `koishi` package to a compatible version as specified in `koishi-plugin-dataview`'s `package.json` peer dependencies, or update the plugin.
TypeError: Cannot read properties of undefined (reading 'registerTab')
This error typically indicates that the Koishi Console plugin (`@koishijs/plugin-console`) was not loaded or initialized before `koishi-plugin-dataview`.
fix
Ensure `app.plugin(Console)` is called before `app.plugin(DataViewPlugin)` in your application entry file.
Upgrade
Version history
2.7.8latest on npm
Audit
Dependencies
@koishijs/plugin-consolerequiredRequired for providing the Koishi web console interface where DataView operates.
koishirequiredCore Koishi framework dependency.
Agent activity
6 hits · last 30 days
node
6
Resources
koishi-plugin-dataview — npm install koishi-plugin-dataview · libregistry