Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

1.2 KB
Raw Blame
//! One-shot plugin installer for local DBX app stores:
//!   cargo run -p dbx-core --example install_plugin -- <plugins-root> <dbxp> <app-version> [--rollback-plugin <id>]
use dbx_core::plugins::{PluginInstallPolicy, PluginPackageInstaller};

fn main() {
    let args: Vec<String> = std::env::args().skip(1).collect();
    if args.len() < 3 {
        eprintln!("usage: install_plugin <plugins-root> <package.dbxp> <app-version>");
        std::process::exit(2);
    }
    let installer = PluginPackageInstaller::new(std::path::PathBuf::from(&args[0]), &args[2]).expect("installer");
    match installer.install_file(std::path::Path::new(&args[1]), PluginInstallPolicy::LocalDevelopment) {
        Ok(result) => {
            let response = result.response();
            println!(
                "installed {} v{} (previous: {:?}, signature: {:?}, sha256: {})",
                response.plugin.manifest.id,
                response.plugin.manifest.version,
                response.previous_version,
                response.signature,
                response.package_sha256
            );
        }
        Err(error) => {
            eprintln!("install failed: {error}");
            std::process::exit(1);
        }
    }
}