Crates.io | status_manager |
lib.rs | status_manager |
version | 0.0.1 |
source | src |
created_at | 2024-11-01 01:07:29.942563 |
updated_at | 2024-11-01 01:07:29.942563 |
description | Kubernetes apiserver |
homepage | |
repository | https://gitee.com/iscas-system/apiserver |
max_upload_size | |
id | 1431155 |
size | 56,884 |
提供。
cargo add status_manager
use std::env;
use diesel::pg::PgConnection;
use diesel::{update, Connection, ConnectionError};
use diesel::dsl::delete;
use status_manager::cores::create::create_posgres_table;
use crate::cores::create::{create_sqlite3_table, insert_postgres_object, insert_sqlite3_object};
use crate::cores::delete::{delete_postgres_object, delete_sqlite3_object, drop_postgres_table, drop_sqlite3_table};
use crate::cores::query::{list_postgres_object, list_sqlite3_object, query_postgres_table, query_sqlite3_table};
use serde_json::json;
use crate::cores::update::{update_postgres_object, update_sqlite3_object};
use std::collections::HashMap;
use diesel::SqliteConnection;
static SQLITE3_URL: &str = "/data/database.db";
fn main()
{
match establish_sqlite3_connection() {
Ok(mut conn) => {
println!("connecting successfully.");
},
Err(e) => {
eprintln!("Error connecting to the database: {}", e);
},
}
}
fn establish_sqlite3_connection() -> Result<SqliteConnection, ConnectionError> {
SqliteConnection::establish(SQLITE3_URL)
}