feat: Add PostgreSQL and Redis client support
- 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:
@@ -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(())
|
||||
|
Reference in New Issue
Block a user