herolib_rust/postgresclient/src/lib.rs
Mahmoud-Emad b737cd6337
Some checks are pending
Rhai Tests / Run Rhai Tests (push) Waiting to run
feat: convert postgresclient module to independent sal-postgresclient package
- Move src/postgresclient/ to postgresclient/ package structure
- Add comprehensive test suite (28 tests) with real PostgreSQL operations
- Maintain Rhai integration with all 10 wrapper functions
- Update workspace configuration and dependencies
- Add complete documentation with usage examples
- Remove old module and update all references
- Ensure zero regressions in existing functionality

Closes: postgresclient monorepo conversion
2025-06-23 03:12:26 +03:00

42 lines
1.4 KiB
Rust

//! SAL PostgreSQL Client
//!
//! This crate provides a PostgreSQL client for interacting with PostgreSQL databases.
//! It offers connection management, query execution, and a builder pattern for flexible configuration.
//!
//! ## Features
//!
//! - **Connection Management**: Automatic connection handling and reconnection
//! - **Query Execution**: Simple API for executing queries and fetching results
//! - **Builder Pattern**: Flexible configuration with authentication support
//! - **Environment Variable Support**: Easy configuration through environment variables
//! - **Thread Safety**: Safe to use in multi-threaded applications
//! - **PostgreSQL Installer**: Install and configure PostgreSQL using nerdctl
//! - **Rhai Integration**: Scripting support for PostgreSQL operations
//!
//! ## Usage
//!
//! ```rust,no_run
//! use sal_postgresclient::{execute, query, query_one};
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Execute a query
//! let rows_affected = execute("CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT)", &[])?;
//!
//! // Query data
//! let rows = query("SELECT * FROM users", &[])?;
//!
//! // Query single row
//! let row = query_one("SELECT * FROM users WHERE id = $1", &[&1])?;
//!
//! Ok(())
//! }
//! ```
mod installer;
mod postgresclient;
pub mod rhai;
// Re-export the public API
pub use installer::*;
pub use postgresclient::*;