marivo.datasource#
Project-level datasource authoring and management API.
Registration & lifecycle#
Open a context-manageable live ibis backend for a datasource. |
|
Context-manageable datasource backend connection. |
|
Create or replace a project datasource file from a DatasourceSpec. |
|
Represent a PEP 604 union type |
|
DuckDB datasource specification. |
|
SQLite datasource specification. |
|
Trino datasource specification. |
|
MySQL datasource specification. |
|
Postgres datasource specification. |
|
ClickHouse datasource specification. |
|
Load the project datasource catalog. |
|
List configured project datasources as a displayable DatasourceList. |
|
Delete the named project datasource file. |
|
Round-trip the backend and best-effort cache validated env secrets. |
Connection ownership#
connect() returns a caller-owned connection; prefer with md.connect(...).
Inspection, sampling, semantic preview, source health, and parity release their
operation-owned connections before returning. Analysis caches connections until
Session.close(). Connections retain validated environment-secret provenance;
host-injected secrets are never cached.
Internal handshakes have an independent 30-second deadline. raw_sql and
sampling/preview scopes retain their execution timeout, rather than an end-to-end
budget. test() retains its whole-roundtrip deadline. SQLite opens locally on
its caller’s thread and cannot be forcibly interrupted during synchronous open.
Credential injection#
Select a host credential resolver for new operations and runtimes. |
|
Read-only reference and operation facts passed to a host resolver. |
|
Synchronous host adapter; owns authorization and service timeouts. |
|
An explicitly readable, non-serializable secret string. |
|
Host credential resolution failed, with reference-only repair facts. |
|
The selected resolver differs from the runtime's captured source. |
Source constructors#
Build a typed DuckDB file source descriptor for CSV files. |
|
Declare one required runtime request parameter for a physical source. |
|
Build a typed DuckDB JSON physical-source descriptor. |
|
Build a DuckDB file source descriptor for Parquet files. |
|
Declare a DuckDB datasource. |
|
Declare a SQLite datasource. |
|
Declare a Postgres datasource. |
|
Declare a MySQL datasource. |
|
Declare a ClickHouse datasource. |
|
Declare a Trino datasource. |
|
Build a physical table source descriptor. |
|
Declare one typed physical identifier for a table column binding. |
Inspection & snapshots#
Inspect a physical source through metadata and system-catalog hooks only. |
|
Immutable bounded rows and profiles from one explicit source acquisition. |
|
Run terminal SQL exploration and load the complete query result. |
DiscoverySnapshot.contract().show() displays the query-free read contract
for a snapshot, including its selected columns, retained-row shape, and value
evidence state. When persist_values=True, snapshot.retained_values is a
tuple of dictionaries keyed by the selected column names; with the default
persist_values=False it remains unavailable and no follow-up query occurs.
Scope helpers#
Datasource specs and explicit scopes expose bounded render() / show()
cards for agent-relevant state. Specs show only their core connection target,
credential field names, and hidden-configuration count; scopes show guards and
a bounded predicate preview. Read .fields / .env_refs or .values
for exact data, and .contract() for mechanical continuation.
Build an explicitly partitioned authoring acquisition scope. |
|
Build a bounded half-open temporal acquisition scope. |
|
Build an explicitly unpruned authoring acquisition scope. |
Description#
python -m marivo help is an environment bootstrap only. Use the sole public
coordinator, marivo.help("datasource.<target>"), for bounded focused help
rendered from the datasource registry. The md namespace executes datasource
operations and intentionally has no md.help() alias. A
SourceInspection card points to
marivo.help("datasource.SourceInspection.sample") for the complete
single-process acquisition and query-free projection chain.
Show literal fields and env refs for one datasource. |
Catalog & refs#
Datasource identities use marivo.semantic.ref.datasource(...). The
datasource module accepts that exact ref at inspection and raw-SQL boundaries,
but does not define a second ref type.
Read-only catalog over configured project datasources. |
|
Displayable collection of configured project datasource summaries. |
|
Summary row for one configured project datasource. |
|
Literal fields and env refs for one datasource. |
Datasource vs source#
md.duckdb(...) and md.sqlite(...) declare datasources. md.table(...)
is the source descriptor for internal tables/views inside either datasource.
md.parquet(...) and md.csv(...) remain DuckDB file sources.
md.json(...) covers DuckDB JSON files and URLs, including a parameterized
JSON-body POST request. These sources are used with a datasource ref in inspection and
snapshot calls; they are not datasource declarations.
Metadata & sources#
Represent a PEP 604 union type |
|
One typed physical identifier in a projected table source. |
|
Explicit pruned selection and positive acquisition guards. |
|
Explicit unpruned acquisition with positive guards. |
Results#
md.raw_sql(...) returns a bounded terminal RawSqlResult. Its shape
and row_count describe returned bounded rows:
row_count == shape[0] == returned_row_count. Read
requested_limit and is_truncated alongside that count; it is not
full-source cardinality. Ordered columns and isolated to_pandas() are
available, but RawSqlResult has no contract(), typed affordances, or
typed-analysis re-entry.
Result of a datasource connectivity round-trip. |
|
Bounded structured cause for one failed datasource connection test. |