marmotdata/duckdb
Discover schemas, tables, views and foreign key relationships from DuckDB database files
The DuckDB plugin discovers schemas, tables, views and foreign key relationships from DuckDB database files.
Tables are identified in their MRN by the database name, schema and table, for example mrn://asset/table/duckdb/analytics.main.orders. The database name is the file name without its extension, as DuckDB names the catalog, and the identity is tied to the file, so set zone when several machines hold their own copy of the same file name and you want them kept apart or shared deliberately. The name is one you choose, not a cloud availability zone.
File Sources
The path field accepts local paths, S3 URIs (s3://bucket/key) or Git URIs (git::https://...). For S3 and Git sources, the file is downloaded to a temporary directory before discovery and cleaned up afterwards.
See File Sources for the full list of supported backends, authentication options and configuration examples.
Querying
The plugin supports Marmot's data queries. A statement is planned and run against a connection opened with access_mode=read_only, which DuckDB enforces at the engine level: no statement on that connection can write, regardless of how it is phrased. enable_external_access=false additionally blocks anything that would reach outside the file itself, such as read_csv, read_parquet, glob, ATTACH, COPY ... TO and installing or loading an extension; lock_configuration=true stops a statement from turning any of that back on with its own SET. Only a single statement is accepted per call.
This lockdown governs what a statement running through Marmot can do; it is not a substitute for file permissions. The account the Marmot host runs as still needs read access to the underlying file (and nothing more), and that remains the outer boundary this plugin depends on.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick DuckDB from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
s3_sourceGroup of settingsS3 file source configuration
credentialsGroup of settingsAWS credentials for S3 access
use_defaultYes or noUse AWS credentials from environment or default profile (recommended)
idTextAWS access key ID
secretSecretAWS secret access key
tokenSecretAWS session token
profileTextAWS profile to use from shared credentials file
role_arnTextIAM role to assume with the Marmot identity token (AssumeRoleWithWebIdentity); its trust policy names the Marmot issuer as an OIDC provider. Setting it federates: no keys are needed, and region is required. role, if also set, is assumed on top of it
roleTextAWS IAM role ARN to assume with AssumeRole from the base credentials (static keys, a profile, the default chain, or role_arn)
role_external_idTextExternal ID for cross-account role assumption
regionTextAWS region for services
endpointTextCustom endpoint URL for AWS services
git_sourceGroup of settingsGit repository file source configuration
urlTextGit repository URL
refTextBranch, tag or commit to check out
pathTextSubdirectory within the repository
tokenSecretPersonal access token for HTTPS auth
ssh_key_pathTextPath to SSH private key for SSH auth
pathText RequiredPath to the DuckDB database file (local path, s3://bucket/key or git::url)
include_columnsYes or noWhether to include column information in table metadata
enable_metricsYes or noWhether to include table metrics (row counts and sizes)
discover_foreign_keysYes or noWhether to discover foreign key relationships
exclude_system_schemasYes or noWhether to exclude system schemas (information_schema, pg_catalog)
Assets emitted
Metadata this plugin attaches to each discovered asset.
DuckDB
The metadata fields DuckDB emits for table and view assets.
Column
The per-column fields embedded in an asset's schema.
Foreign Key
The fields of a discovered foreign key relationship.