Storq logoStorq

Python API Reference

After installing the package with pip, import it as import storq. Native APIs require the compiled storq._native extension. Several workflow steps are placeholders and must not be mistaken for implemented functionality.

Native extension: storq._native

The names below describe the APIs available to Python users.

Runtime and core

NameUse and callable surface
Runtime()Create a Storq runtime. initialize(), shutdown(), read-only state, context-manager entry/exit. initialize() starts it; shutdown() stops modules.
RuntimeStateUninitialized, Initializing, Running, ShuttingDown, Stopped, Failed. Values report lifecycle only.
StorqNativeErrorException registered by the native module for StorqException failures. Catch it around native operations.
VersionInfoRead-only major, minor, patch, and string. The class is registered by the extension, but no current Python binding function returns it.

The root storq module re-exports Runtime and RuntimeState when native loading succeeds, but it does not re-export StorqNativeError; access it as storq._native.StorqNativeError.

SQLite adapter and inspection

NameUse and methods
DatabaseEngineEnum values SQLite, Unknown. Other engine values are not available in Python.
AdapterStateLifecycle enum: Uninitialized, Initializing, Ready, Connected, Failed, ShuttingDown, Stopped.
AdapterConfig()Mutable database_path and settings; pass to SQLiteAdapter.initialize(config).
DatabaseConnectionConfig()Mutable database_path, read_only, and timeout; currently defined in the binding but there is no Python connect() method binding.
SQLiteAdapter()initialize(config), shutdown(), can_open(path), and read-only engine, name, version, state. It identifies valid SQLite files; Python cannot create connections through this class yet.
SQLiteInspector()inspect(path) returns database metadata via the bound inspector implementation.
inspect_format(path)Convenience function returning FormatInspectionResult with format, file size, page size/count, and header/structure validity.
FormatInspectionResultRead-only format, file_size, page_size, page_count, header_valid, and structure_valid.

The Python inspect_format binding creates and tears down its own runtime. Use it for basic file inspection. Detailed reports, parser registration, and page analysis are not available through this Python API.

Native Storq format and records

NameUse and methods
supported_storq_page_sizes()Return the supported page-size list. Current values are 4096, 8192, 16384, 32768, and 65536.
create_storq_database(path, page_size)Create an experimental Storq-format file. It fails on invalid sizes or file errors.
inspect_storq_database(path)Open read-only and validate the Storq header and metadata page.
StorqFormatMetadataRead-only UUID string, version major/minor/string, page size/count, physical file size, and metadata generation.
RecordIDRead-only page_id, slot_id, generation; supports str(), equality, and hashing. Its string representation can be passed back to record methods.
RecordManager(path)open(), close(), insert(dict) -> str, read(record_id_string) -> dict, update(record_id_string, dict), delete(record_id_string), and exists(record_id_string). Call open() before record methods and close() when finished.

Record identifiers are generation-aware. Invalid, stale, deleted, or malformed IDs produce errors instead of resolving as another record.

Workload generation and independent oracle

NameUse and methods
KeyDistributionUniform, Sequential, Hot, Zipf; choose key-generation distribution in WorkloadConfig.
SchedulingPolicySequential, DeterministicConcurrent, Concurrent; choose scheduling behavior for generated workloads.
WorkloadConfig()Mutable random_seed, operation_count, transaction_count, concurrency_level, deterministic_execution, key_distribution, scheduling_policy, and profile_name.
TransactionGenerator(config)generate() returns a list of generated transaction descriptions; it does not itself execute SQL.
WorkloadOperationRead-only operation_id, transaction_id, target_key, sequence_number.
WorkloadTransactionRead-only transaction_id, operations, expects_commit, commit_synchronized.
TransactionOracle()register_transaction(transaction), record_commit(id, synchronized), record_rollback(id), and read-only history. Stores expected outcomes independently of a database.
ExpectedTransactionRead-only oracle-history entry, including transaction_id, expected_state, synchronization/durability flags, and expected values. Its state is an ExpectedTransactionState enum in storq._native.

Use generated workloads as inputs for a caller-controlled harness. The Python binding does not currently expose a direct “execute this workload against SQLite, inject a fault, crash, and verify recovery” workflow.

Index and native WAL bindings

NameUse and methods
HashIndex(name, path)Experimental hash-index wrapper. Python currently provides load() and save() only; inserting, finding, and deleting entries are not available through this API.
NativeWAL(database_path)Experimental Storq WAL wrapper. Python binds open(), sync(), and read-only last_lsn. Append and read records are not exposed in Python.

These are Storq-native data structures, not SQLite WAL parsing functions. SQLite WAL analysis is not currently available through the Python SDK.

Examples for the available native APIs

The snippets below use the compiled extension. Each file created or modified by the examples should be disposable; Storq-format record changes are not transactional.

Runtime and SQLite adapter

Runtime can be used as a context manager to initialize and shut down the native runtime. The adapter can identify a SQLite file; the Python binding does not provide an adapter connection method. SQLiteInspector.inspect() returns metadata without exposing a Python database connection.

python
import sqlite3
from contextlib import closing
import storq

with storq.Runtime() as runtime:
    print("Runtime state:", runtime.state)

database = "example.sqlite"
with closing(sqlite3.connect(database)) as connection:
    connection.execute("CREATE TABLE sample (id INTEGER PRIMARY KEY)")

config = storq.AdapterConfig()
config.database_path = database

adapter = storq.SQLiteAdapter()
adapter.initialize(config)
try:
    print(adapter.engine, adapter.name, adapter.state)
    print("Can open:", adapter.can_open(database))
finally:
    adapter.shutdown()

metadata = storq.SQLiteInspector().inspect(database)
print(metadata.engine, metadata.file_size, metadata.page_size, metadata.page_count)

AdapterConfig.settings is available for adapter settings; DatabaseConnectionConfig is currently a data container only, because no Python connect() binding is provided. For the simpler, read-only format summary, call storq.inspect_format(database).

Phase 2 also provides the higher-level managed SQLite connection:

python
import storq

with storq.open_database("example.sqlite") as database:
    with database.transaction() as transaction:
        transaction.execute(
            "INSERT INTO items(name) VALUES (:name)",
            {"name": "sample"},
        )

    print(database.fetchall("SELECT name FROM items"))
    print(database.quick_check())

open_database() requires an existing file; it does not create a database implicitly. Positional parameters and named :name, @name, or $name parameters are bound safely. The read_only=True option rejects mutations. quick_check() and integrity_check() provide explicit SQLite health checks; they are not run after every commit unless a ManagedHealthPolicy opts in. Managed connections expose is_healthy and health_error. A failed health check or SQLite error that makes an outcome uncertain marks that connection unhealthy and blocks later writes on it; reads remain available where SQLite allows them. A transaction-context commit failure attempts rollback if the transaction is still active, and both commit and rollback failures are surfaced.

Phase 3 adds bounded in-memory operation/transaction history, pre-commit application invariants, and optional post-commit health checks:

python
health = storq.ManagedHealthPolicy(
    mode="quick",  # "none", "quick", "integrity", or "custom"
    invariants=(lambda database: database.fetchone(
        "SELECT COUNT(*) FROM items"
    )[0] >= 0,),
    include_parameters=False,
)

with storq.open_database("example.sqlite", health_policy=health) as database:
    with database.transaction() as transaction:
        transaction.execute("INSERT INTO items(name) VALUES (?)", "checked")

    print(database.transaction_history[-1].status)
    print(database.operation_history[-1].commit_state)

Invariants run before a managed transaction commits. Return True or None to accept it; return False or raise to reject and roll back. Direct managed write statements are wrapped in a transaction when invariants are configured. quick and integrity run the corresponding SQLite check after successful commits. custom requires a read-only health_check(database) callback that returns True or None when healthy and False otherwise. A failed post-commit check raises PostCommitHealthCheckError with transaction_committed=True; the committed transaction is not undone.

operation_history and transaction_history are bounded, in-memory diagnostics (default limit 1000), not durable audit logs or a replay journal. Records include sequence, transaction ID, SQL category, outcome, and affected-row count when the native extension provides it. SQL parameters are omitted by default; include_parameters=True may retain sensitive values and should be enabled only when appropriate. SQLite busy, locked, I/O, and corruption errors are classified in operation records; uncertain outcomes remain distinct from confirmed failures.

Phase 2 adds named, verified recovery points and optional checkpoint policies:

python
policy = storq.RecoveryPointPolicy(
    mode="transaction",
    backup_directory="./example-backups",
    retain=7,
)

with storq.open_database(
    "example.sqlite",
    recovery_points=policy,
) as database:
    with database.transaction() as transaction:
        transaction.execute(
            "INSERT INTO items(name) VALUES (?)",
            "checkpointed",
        )

    points = database.list_recovery_points("./example-backups")
    print(points[0]["generation"], points[0]["verified"])

The default RecoveryPointPolicy(mode="checkpoint") does not create points automatically. Call database.create_recovery_point("before-migration") to create a named point after the active transaction commits. mode="transaction" creates a point after every successful managed write or transaction commit; mode="interval" creates one after the configured transaction count or time threshold is reached (time thresholds are checked on commits, not by a background timer). mode="off" disables automatic point creation but keeps the explicit API available.

Automatic point creation runs after the SQL transaction commits. If the checkpoint fails, RecoveryPointCreationError is raised with transaction_committed=True; the committed database transaction is not undone. Its recovery_point_created flag distinguishes a snapshot failure from a retention-cleanup failure, and includes the point manifest when the snapshot was created. Automatic policies can perform substantial I/O, especially transaction mode.

Recovery points use SQLite's native online backup API, verify the output with quick_check or integrity_check, and publish a JSON manifest only after verification. The manifest records source identity, observed source hash, backup hash, journal mode, SQLite versions, verification method, and sidecar inventory. backup_sha256 identifies the exact snapshot; source_hash is an observation of the main database file and is not a hash of the logical consistent snapshot when WAL is active. Retention applies only to verified generations for that source database and never removes the last verified point.

create_backup() remains available for unnamed backup generations. A recovery point is a verified backup, not an automatic restore or repair operation.

Durable transaction journal and replay (Phase 4)

transaction_journal is opt-in and must identify a file separate from the SQLite database. The journal stores managed transaction SQL and bound parameters so that committed transactions after a recovery point can be replayed:

python
with storq.open_database(
    "example.sqlite",
    transaction_journal="example.storq-journal",
) as database:
    with database.transaction(idempotency_key="order-123") as transaction:
        transaction.execute(
            "INSERT INTO orders(order_id, total) VALUES (?, ?)",
            "order-123",
            42.50,
        )

    status = database.transaction_status(idempotency_key="order-123")
    point = database.create_recovery_point("after-order-123")
    # After restoring the point's backup into a separate candidate:
    result = database.replay_committed_transactions(candidate, after=point)

The append-only journal uses a checksum chain, flushes records before acknowledging a commit, and takes an exclusive writer lock. It does not make SQLite and the separate journal one atomic storage operation. If SQLite commits but the commit decision cannot be durably appended, Storq raises JournalDecisionError with transaction_committed=True and acknowledged=False, blocks further writes, and requires operator resolution. An intent without a durable decision, a damaged journal, or unsupported replay input also blocks replay and further journaled writes.

The strict replay subset accepts only supported deterministic SELECT, INSERT, UPDATE, and DELETE statements; unsupported functions, SQL constructs, triggers, and other unsafe schema features are rejected before execution. A replay cursor is committed atomically with each transaction's candidate effects, allowing replay to resume without applying a committed transaction twice. after accepts a transaction sequence or a recovery-point manifest containing a sequence fence; replay modifies only the candidate and does not verify or promote it.

Journal contents are not encrypted and include SQL plus bound values, which may contain sensitive data. Protect the journal and its .lock file accordingly. There is no journal retention or compaction yet, so the file grows over time. Checksums detect accidental changes but are not an authentication mechanism; the implementation does not guarantee replay of arbitrary SQLite SQL, side effects outside SQLite, or writes that bypass the managed connection. This is not automatic corruption recovery or a guarantee of physical power-loss durability.

Recovery detection and candidate preparation (Phase 5)

Managed connections expose the latest in-memory recovery_result and recovery_action_log. Storq records recovery_required when a managed SQLite operation reports corruption or an uncertain I/O failure, or when an explicit health check fails. A lightweight PRAGMA data_version comparison around managed operations detects writes committed by other SQLite connections; detected external writes mark the result inconclusive and block managed writes. This check does not detect every raw file edit or replace WAL/sidecar validation.

Candidate preparation is explicit and never promotes or overwrites the source:

python
with storq.open_database("example.sqlite") as database:
    result = database.prepare_recovery_candidate(
        backup_directory="./example-backups",
        full_integrity=True,
    )

    if result.status == "recovery_ready":
        print(result.selected_point["generation"])
        print(result.candidate_path)
        print(result.verification_evidence)

prepare_recovery_candidate() runs quick_check, restores the newest verified recovery point to a separate candidate, and independently verifies that candidate. A passing result means only that the candidate checks passed; it does not prove semantic correctness, replay journaled transactions after the point, or establish that no writes bypassed Storq. Candidate replay, promotion, and automated recovery policies are later phases. The recovery result and action log exist only for the lifetime of the managed Python object.

Evidence workspaces

Evidence workspaces provide isolated evidence copies for later diagnosis or recovery:

python
from pathlib import Path
import storq

workspace = storq.create_evidence_workspace(
    "damaged.sqlite",
    Path("evidence-root"),
)

print(workspace.verify())
print(workspace.to_dict())
print(workspace.action_log)
candidate = workspace.new_candidate("candidate.sqlite")

The source is copied into a unique subdirectory, hashed before and after, and recorded in a JSON manifest plus append-only JSONL action log. Candidate paths must remain inside the workspace and use plain filenames. Evidence verification detects source changes and evidence corruption; it does not repair data.

Phase 9: independent verification reports

Evidence workspaces can publish a hashed JSON verification report:

python
report_entry = workspace.write_verification_report({
    "status": "passed",
    "source_hash": storq.file_sha256("damaged.sqlite"),
    "candidate_hash": storq.file_sha256("candidate.sqlite"),
    "candidate_verification": {"status": "passed"},
    "limitations": [],
})
print(report_entry["report"], report_entry["sha256"])

Promotion can require this report:

python
database.close()
promotion = database.promote_recovered_candidate(
    "candidate.sqlite",
    independent_verification={
        "status": "passed",
        "limitations": [],
    },
)

An independent report is only accepted when status="passed". inconclusive or failed reports block promotion. The report is not proof of semantic correctness or complete reconstruction.

Read-only database diagnosis

Phase 5 combines format, bounded page, and optional SQLite WAL analysis:

python
diagnosis = storq.diagnose_database(
    "sample.sqlite",
    include_wal=True,
    maximum_pages=100000,
    maximum_frames=1000000,
)
print(diagnosis["format"])
print(diagnosis["pages"])
print(diagnosis["wal"])

diagnose_database() returns JSON-safe dictionaries and SHA-256 hashes. Native page and WAL findings include severity, location, description, expected and observed values, and completeness status. It opens inspected files read-only and never repairs or changes the source.

Phase 8: reproducible fault scenarios and forensic evidence

Use FaultConfiguration and run_fault_scenario() to exercise a workload against a disposable copy:

python
report = storq.run_fault_scenario(
    "source.sqlite",
    "evidence",
    [{"operation_id": "insert",
      "sql": "INSERT INTO items(name) VALUES (?)",
      "parameters": ("value",)}],
    fault=storq.FaultConfiguration(
        kind="corrupt", trigger_after=1, offset=100, length=1, seed=42
    ),
)
print(report["reproducibility"])
print(report["observed"]["diagnosis"])

Supported simulations are none, truncate, corrupt, and interrupt. Workloads use a caller-supplied execution_adapter(connection, operation) or the default adapter shown above. The source is copied into an isolated evidence workspace and is never the execution target. Reports include hashes, workload and fault identities, sanitized operation traces, diagnosis, and limitations. Parameters are omitted unless include_sensitive=True. These simulations do not intercept unrelated processes or prove physical power-loss durability, and observed facts are not presented as causal proof.

Phase 10: recovery certification

Run multiple deterministic disposable fault scenarios and export an aggregate JSON report:

python
certification = storq.run_recovery_certification(
    "source.sqlite",
    "certification-evidence",
    [{"operation_id": "insert",
      "sql": "INSERT INTO items(name) VALUES (?)",
      "parameters": ("value",)}],
    configuration=storq.RecoveryCertificationConfiguration(
        scenarios=("none", "truncate", "corrupt", "interrupt", "lock", "crash"),
        seed=42,
        iterations=3,
    ),
)
print(certification["status"])
print(certification["report"])

The runner changes only isolated working copies and verifies that the original source hash is unchanged. Reported results are observations; lost, uncertain, and preserved transactions are not inferred into causal claims. This harness does not certify physical power-loss durability or guarantee production recovery behavior.

Phase 6: restore a verified backup

Restore planning and execution create a separate candidate:

python
with storq.open_database("source.sqlite") as database:
    plan = database.plan_restore(
        "./example-backups",
        candidate="recovered.sqlite",
    )
    print(plan)

    if plan["status"] == "ready":
        result = database.restore_backup_to(
            "recovered.sqlite",
            "./example-backups",
            full_integrity=True,
        )
        print(result)

The restore rechecks the selected backup hash and SQLite integrity, then copies it to a temporary file and atomically replaces only the nonexistent candidate path. It refuses to use the source as the candidate and never modifies the source. This is a restore candidate, not automatic promotion or salvage.

The backup manifest reports the active journal mode and hashes present source -wal, -shm, and -journal sidecars. Sidecar hashes are inventory evidence; they are not copied into a candidate. Restoring candidates and promoting them only use the standalone SQLite snapshot. Candidate verification rejects any WAL/SHM/rollback-journal sidecar beside the candidate. Explicit promotion preserves source sidecars alongside the rollback and restores them if promotion fails.

Phase 7: verify and explicitly promote

Verification is independent of restore execution:

python
verification = database.verify_recovered_candidate(
    "recovered.sqlite",
    full_integrity=True,
    check_foreign_keys=True,
)
print(verification["status"])

if verification["status"] == "passed":
    promotion = database.promote_recovered_candidate(
        "recovered.sqlite",
        rollback_directory="./rollbacks",
    )
    print(promotion)

Promotion requires the managed connection to be closed. It refuses candidates that fail SQLite integrity or foreign-key checks. After verification, Storq copies the original source to a rollback file, removes live -wal/-shm sidecars, promotes the candidate as the new source, and retains a rollback manifest. Promotion is explicit and never replaces a failed candidate.

When transaction journaling is enabled, restore the selected point with the explicit Phase 7 workflow so replay and verification are represented together:

python
point = database.create_recovery_point("before-recovery")
candidate = database.restore_recovery_candidate(
    point,
    "recovered.sqlite",
)

if candidate["status"] == "passed":
    database.close()
    promotion = database.promote_recovered_candidate(
        "recovered.sqlite",
        rollback_directory="./rollbacks",
        preserve_damage=True,
        recovery_result=candidate,
    )

restore_recovery_candidate() restores from the point backup, replays later acknowledged replay-safe transactions, and verifies the resulting candidate. promote_recovered_candidate() refuses an incomplete replay result. It retains a rollback and, when preserve_damage=True, also archives the pre-promotion source and sidecars.

Phase 8: automatic recovery policy

Automatic recovery is opt-in. The default is observe, and promotion is never performed without promote_verified:

python
policy = storq.RecoveryPolicy(
    mode="prepare_candidate",
    preserve_damage=True,
    full_integrity=True,
    check_foreign_keys=True,
)

with storq.open_database("source.sqlite", recovery=policy) as database:
    result = database.execute_recovery_policy(
        backup_directory="./example-backups",
    )
    print(result["status"], result["candidate"], result["promoted"])

Supported modes:

  • observe: detect and report only; never restore or promote.
  • prepare_candidate: restore and verify a candidate, but do not promote.
  • promote_verified: require a verified candidate and complete replay, close the managed connection, and explicitly execute promotion.
  • fail_closed: mark the connection unhealthy and reject managed writes.

promote_verified cannot silently replace an active connection. Calling execute_recovery_policy() with an open connection returns blocked. Close the managed connection, reopen if necessary, and call the policy only after operator verification. Automatic promotion also preserves the rollback and optional damaged-source archive according to policy.

Storq format and record operations

storq.format is a small Python wrapper around the native Storq-format functions. The root-level functions offer the same operations.

python
from pathlib import Path
from tempfile import TemporaryDirectory

import storq
from storq import format as storq_format

print(storq_format.supported_page_sizes())

with TemporaryDirectory() as directory:
    path = Path(directory) / "demo.storq"
    storq_format.create(path, page_size=4096)
    metadata = storq_format.inspect(path)
    print(metadata.version, metadata.page_size, metadata.page_count)

    manager = storq.RecordManager(str(path))
    manager.open()
    try:
        record_id = manager.insert({"name": "sample", "active": True})
        print(manager.exists(record_id), manager.read(record_id))
        manager.update(record_id, {"name": "updated"})
        print(manager.read(record_id))
        manager.delete(record_id)
        print(manager.exists(record_id))
    finally:
        manager.close()

RecordManager methods require an open manager. Use the returned record ID string with read, update, delete, and exists; stale or malformed IDs raise an error. format.inspect(..., read_only=...) always performs a read-only inspection; its read_only argument is currently ignored.

Generate a workload and record expected outcomes

The generator creates descriptions, not SQL statements or database changes. The oracle stores the expected outcome separately so a caller-owned harness can compare it with its own results.

python
import storq

config = storq.WorkloadConfig()
config.random_seed = 42
config.operation_count = 20
config.transaction_count = 4
config.key_distribution = storq.KeyDistribution.Sequential

transactions = storq.TransactionGenerator(config).generate()
oracle = storq.TransactionOracle()
for transaction in transactions:
    oracle.register_transaction(transaction)
    if transaction.expects_commit:
        oracle.record_commit(
            transaction.transaction_id, transaction.commit_synchronized
        )
    else:
        oracle.record_rollback(transaction.transaction_id)

print("Generated:", len(transactions))
print("Tracked outcomes:", [
    (item.transaction_id, item.expected_state)
    for item in oracle.history
])

random_seed makes generation repeatable for the same configuration. key_distribution and scheduling_policy select generator metadata; they do not execute or schedule work against a database.

Persistence-only index and WAL wrappers

These wrappers expose only the operations shown here. They cannot insert or look up index entries, append WAL records, or analyze a SQLite WAL from Python. This example creates its files in a temporary directory; use only disposable data when trying these experimental formats.

python
from pathlib import Path
from tempfile import TemporaryDirectory

import storq

with TemporaryDirectory() as directory:
    index = storq.HashIndex("example", Path(directory) / "example.index")
    index.load()
    index.save()

    database_path = Path(directory) / "example.storq"
    wal = storq.NativeWAL(database_path)
    wal.open()
    print("Last LSN:", wal.last_lsn)
    wal.sync()

NativeWAL accepts a database path and opens its .storq-wal sidecar. The wrapper does not offer a Python API to populate the index or append WAL records, so these calls alone are not a complete persistence workflow.

storq.format

This Python module wraps native Storq-format operations:

  • supported_page_sizes() returns page sizes. If the extension is absent it returns a hard-coded list; that fallback does not prove native support.
  • create(path, page_size=4096) creates a Storq file; raises RuntimeError if the extension is unavailable.
  • inspect(path, read_only=True) opens and validates the file. The read_only parameter is currently ignored; the native operation always opens read-only.

Root-level pure-Python exports

storq.__init__ re-exports these modules and classes/functions:

storq.workflows

Workflow, WorkflowBuilder, WorkflowConfig, WorkflowContext, WorkflowStatus, StepStatus, WorkflowResult, WorkflowEvent, WorkflowHistory, templates, and steps. The storq.workflows submodule also exports DependencyResolver, DependencyError, CheckpointManager, CheckpointError, CancellationManager, RetryManager, EventDispatcher, StepResult, serialize, serialize_json, save, deserialize, and SerializationError. Details and limitations are in Workflows and test suites.

storq.reporting

Report, ReportMetadata, ReportSection, ReportFinding, ReportStatistics, ReportEvidence, ReportChart, ReportTimeline, ReportTable, ReportExportResult, ReportingConfig, ReportBuilder, ReportingEngine, ReportDataNormalizer, ReportComparison, compare_reports, ReportHistory, report_history, and reporting. The storq.reporting submodule also exports ReportTemplateRegistry, registry, VisualizationEngine, and OptionalDependencyError. Details are in Reports and benchmarks.

storq.testing

TestConfig, TestStatus, TestResult, SuiteResult, TestCase, TestSuite, and the testing module alias (storq.tests).

Built-in factories are page_integrity(), wal_integrity(), recovery_consistency(), storage_reliability(), fault_tolerance(), transaction_consistency(), and concurrency_reliability(). Only the page_integrity() case currently performs native format inspection. The others are capability placeholders, not actual checks.

storq.benchmarking

BenchmarkConfig, BenchmarkMeasurement, BenchmarkResult, BenchmarkEngine, Benchmark, BenchmarkSuite, BenchmarkComparison, compare_benchmarks, BenchmarkHistory, latency_stats, percentile, BenchmarkWorkload, WorkloadManager, workload, and create_workload. Additional helpers are available from storq.benchmarking, including mean, median, stddev, coefficient_of_variation, environment_fingerprint, detect_regressions, export_json, and export_csv. See Reports and benchmarks.

Error behavior and imports

Native functions raise storq._native.StorqNativeError for native operation failures, or Python argument/type errors for invalid inputs. Do not interpret the pure-Python fallback's presence as proof of native functionality:

python
import storq

if not callable(storq.inspect_storq_database):
    raise RuntimeError("Storq native extension is not installed")