Skip to main content
Rust4PM

extraction_dbcon_bindings

process_mining::bindings::extraction_dbcon_bindings

Functions in this Module(6)

extraction_column_domain

bindings::extraction_dbcon_bindingsSource

The distinct values table.column holds in the source named source_id, for compiling a

dynamic type name (one read from a column rather than written in the blueprint) to SQL. See ExtractionCatalog::with_domain.

connections must contain an entry for source_id. Every other entry is ignored.

Arguments
String
String
String
import r4pm

res = r4pm.bindings.extraction_column_domain(
    {"something": 'example'},
    'example',
    'example',
    'example',
)

extraction_connection_kinds

bindings::extraction_dbcon_bindingsSource

The source kinds this build's connector can open, as dbcon backend ids ("csv",

"parquet", "xlsx", "sqlite", "duckdb", "postgres"). Lets a UI offer exactly the kinds the running binary supports instead of hardcoding a per-build list.

Asked of dbcon itself rather than derived from this crate's extraction-dbcon* features: under Cargo feature unification another crate in the graph can enable a dbcon backend those features do not name.

import r4pm

res = r4pm.bindings.extraction_connection_kinds()

extraction_discover_catalog

bindings::extraction_dbcon_bindingsSource

Connect to every source in connections and discover its schema, returning one merged

ExtractionCatalog a caller can extraction_validate or extraction_compile a blueprint against, or edit further with ExtractionCatalog::with_domain entries from extraction_column_domain.

connections maps each source id a blueprint's nodes name to a dbcon connection string (postgres://..., postgresql://..., sqlite:..., or a bare path ending in .csv).

Arguments
ExtractionCatalog

The concrete, serializable [`Catalog`].

import r4pm

res = r4pm.bindings.extraction_discover_catalog({"something": 'example'})

extraction_run

bindings::extraction_dbcon_bindingsSource

Run blueprint against connections, storing the extracted log under output_id and

returning the ExtractionReport.

An item already stored under output_id is replaced. connections maps each source id blueprint's nodes name to a dbcon connection string. The blueprint itself carries no connection details, so the same blueprint can run against different connections (a staging database, then production) with no edit.

Arguments

A declarative mapping from relational rows to an OCEL.

Store the produced item under this id, replacing any item already stored there.

ExtractionReport

What [`extract`](super::extract::extract) produced, beyond the OCEL itself.

import r4pm

blueprint = {
    "mappings": [{"type": 'single'}],
    "nodes": [
        {
            "id": '893f8ab9',
            "op": {
                "source_id": 'example',
                "table": 'example',
                "type": 'source',
            },
        },
    ],
    "version": 1,
}
res = r4pm.bindings.extraction_run(
    blueprint,
    {"something": 'example'},
    output_id='example',
)

extraction_run_to_duckdb

r4pm-fullbindings::extraction_dbcon_bindingsSource

Run blueprint against connections, streaming straight to a new DuckDB file at

db_path instead of holding the log in memory.

options apply as in [write_ocel_to_duckdb]: without overwrite, an existing db_path is an error, and a failed run removes the new file again.

The right choice for a source too large to fit in RAM. See extraction_run for a log kept as an in-process handle instead. Read the written file back by importing its .duckdb path as an OCEL or SlimLinkedOCEL (Importable, or the registry).

Arguments

A declarative mapping from relational rows to an OCEL.

String

Options controlling how an OCEL is written into a `DuckDB` database.

ExtractionReport

What [`extract`](super::extract::extract) produced, beyond the OCEL itself.

import r4pm

blueprint = {
    "mappings": [{"type": 'single'}],
    "nodes": [
        {
            "id": '893f8ab9',
            "op": {
                "source_id": 'example',
                "table": 'example',
                "type": 'source',
            },
        },
    ],
    "version": 1,
}
res = r4pm.bindings.extraction_run_to_duckdb(
    blueprint,
    {"something": 'example'},
    'example',
)

extraction_table_preview

bindings::extraction_dbcon_bindingsSource

The first limit rows of table in the source named source_id, for showing a person what

the data looks like while they build a blueprint against it.

Not a substitute for [extraction_column_domain]: a preview is incomplete, so it must never be used where the compiler needs a column's full domain.

connections must contain an entry for source_id. Every other entry is ignored.

Arguments
String
String
TablePreview

A few real rows of one table, for display only.

import r4pm

res = r4pm.bindings.extraction_table_preview(
    {"something": 'example'},
    'example',
    'example',
)