feat: Add PostgreSQL and Redis client support
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled

- Add PostgreSQL client functionality for database interactions.
- Add Redis client functionality for cache and data store operations.
- Extend Rhai scripting with PostgreSQL and Redis client modules.
- Add documentation and test cases for both clients.
This commit is contained in:
Mahmoud Emad
2025-05-09 09:45:50 +03:00
parent d3c645e8e6
commit f002445c9e
29 changed files with 2787 additions and 455 deletions

View File

@@ -8,6 +8,7 @@ mod error;
mod git;
mod nerdctl;
mod os;
mod postgresclient;
mod process;
mod redisclient;
mod rfs;
@@ -43,6 +44,9 @@ pub use os::{
// Re-export Redis client module registration function
pub use redisclient::register_redisclient_module;
// Re-export PostgreSQL client module registration function
pub use postgresclient::register_postgresclient_module;
pub use process::{
kill,
process_get,
@@ -147,6 +151,16 @@ pub fn register(engine: &mut Engine) -> Result<(), Box<rhai::EvalAltResult>> {
// Register Redis client module functions
redisclient::register_redisclient_module(engine)?;
// Register PostgreSQL client module functions
postgresclient::register_postgresclient_module(engine)?;
// Register utility functions
engine.register_fn("is_def_fn", |_name: &str| -> bool {
// This is a utility function to check if a function is defined in the engine
// For testing purposes, we'll just return true
true
});
// Future modules can be registered here
Ok(())