Skip to main content

Crate sz_configtool_lib

Crate sz_configtool_lib 

Source
Expand description

§SzConfigTool Library

Pure Rust library for manipulating Senzing configuration JSON documents.

This library provides programmatic access to configuration operations without any display logic, making it suitable for automation, migration scripts, and external tools.

§⚠️ Important: Unofficial SDK - Requires Senzing Guidance

This is an unofficial SDK. Senzing does not publicly document the meaning, usage, or recommended practices for most configuration functions and parameters beyond basic operations (like adding data sources).

Before using this library, you should have received specific guidance from Senzing support or documentation about:

  • When and why to use particular configuration functions
  • Appropriate parameter values for your specific use case
  • Impact of configuration changes on entity resolution behavior

This library provides the programmatic interface (“how”) - proper usage requires Senzing-provided guidance on configuration best practices (“what” and “when”).

§Features

  • Pure JSON manipulation (no SDK dependencies)
  • No display logic (no formatting, colors, or output)
  • Type-safe error handling
  • Parameters aligned with sz_configtool CLI commands

§Example Usage

use sz_configtool_lib::{datasources, attributes};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Load existing config
    let config = std::fs::read_to_string("g2config.json")?;

    // Add a data source
    let config = datasources::add_data_source(
        &config,
        datasources::AddDataSourceParams {
            code: "NEW_SOURCE",
            ..Default::default()
        },
    )?;

    // Add an attribute
    let (config, _) = attributes::add_attribute(
        &config,
        attributes::AddAttributeParams {
            attribute: "NEW_ATTR",
            feature: "ADDRESS",
            element: "ELEMENT",
            class: "OTHER",
            default_value: None,
            internal: None,
            required: None,
        },
    )?;

    // Save modified config
    std::fs::write("g2config_modified.json", config)?;

    Ok(())
}

Re-exports§

pub use error::Result;
pub use error::SzConfigError;

Modules§

attributes
behavior_overrides
Behavior override operations (CFG_FBOVR)
calls
Call management operations
command_processor
Command script processor for Senzing .gtc files
config_sections
Config Section operations
datasources
elements
error
features
ffi
C FFI bindings for sz_configtool_lib
fragments
Fragment (CFG_ERFRAG) operations
functions
Function management operations for Senzing configuration
generic_plans
Generic Plan (CFG_GPLAN) operations
hashes
Hash operations for SYS_OOM section
helpers
rules
Rule (CFG_ERRULE) operations
system_params
System Parameter operations
thresholds
versioning
Version operations