| Crates.io | dbmeta |
| lib.rs | dbmeta |
| version | 0.1.0 |
| created_at | 2025-08-21 14:10:25.398662+00 |
| updated_at | 2025-08-21 14:10:25.398662+00 |
| description | Easy access to database metadata |
| homepage | |
| repository | https://github.com/Ranxy/dbmeta |
| max_upload_size | |
| id | 1804891 |
| size | 147,661 |
dbmeta is an open source Rust library for managing and interacting with multiple database backends, including MySQL and PostgreSQL. It provides a unified interface for obtaining database metadata, making it easier to build Rust applications that require metadata from multiple databases.
Add dbmeta to your Cargo.toml:
[dependencies]
dbmeta = { version =0.1, features=["db-all"]}
use dbmeta::db;
fn main() {
let cfg = db::ConnectionConfig {
engine: db::Engine::MYSQL,
host: "localhost".into(),
port: 3306,
username: "username".into(),
password: "password".into(),
database: "database".into(),
};
let driver = db::create_driver(&cfg).await.unwrap();
let instance = driver.sync_instance().await.unwrap();
println!("Database instance: {:?}", instance);
let databases = driver.sync_database().await.unwrap();
println!("Databases: {:?}", databases);
}
This project is licensed under the Apache License. See the LICENSE file for details.
Some codes are translated from the open source project Bytebase.