Scan your whole stack
From OX Research Newsroom
Are you using @molecule/api-database-motherduck?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.1.4
@molecule/api-database-motherduck was last scanned on 26 Nov 2026 at version 1.1.4. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.1.4 LATEST | 26 Nov 2026 | No rules fired |
| 1.1.3 | 4 Nov 2026 | No rules fired |
| 1.1.2 | 26 Oct 2026 | No rules fired |
| 0.0.1-stage | 24 Oct 2026 | Not shown |
Findings for v1.1.4. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.1.4; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
MotherDuck database provider for molecule.dev — hosted DuckDB in the cloud,
reached through the same @duckdb/node-api client with an md: connection
string.
MotherDuck is built in partnership with DuckDB's creators and runs DuckDB
SQL, so everything true of the @molecule/api-database-duckdb bond is true
here — same placeholders, same DataStore, same migrations — with the
database living in your MotherDuck account instead of a local file. Pick
this bond when several processes or machines need one analytical database,
or when the data is already in MotherDuck.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
import { setPool, setStore } from '@molecule/api-database'
import { pool, store } from '@molecule/api-database-motherduck'
setPool(pool)
setStore(store)
provider
npm install @molecule/api-database-motherduck @duckdb/node-api @molecule/api-bond @molecule/api-database @molecule/api-database-duckdb @molecule/api-secrets
MigrationOptionsOptions for the migration runner.
interface MigrationOptions {
/** Prefix for ledger keys when one database applies SQL from more than one directory. */
namespace?: string
}
MotherduckConfigConfiguration for a MotherDuck-backed pool.
interface MotherduckConfig {
/**
* The `md:` connection string — `md:` (the account's default database) or
* `md:<database>`. Extra parameters may be appended
* (`md:my_db?session_name=…`). Defaults to the `MOTHERDUCK_DATABASE` env
* var, then `md:`.
*/
connectionString?: string
/**
* The MotherDuck token. Read lazily at first use, never at import time.
* Defaults to the `MOTHERDUCK_TOKEN` env var (the client also auto-reads a
* lowercase `motherduck_token` env var by itself — either works).
*/
token?: string
/**
* Which env var holds the token (default `MOTHERDUCK_TOKEN`). Only useful
* for one pool among several.
*/
tokenEnv?: string
/**
* Extra DuckDB settings handed to `DuckDBInstance.fromCache(connectionString,
* options)` as-is (`session_name`, `dbinstance_inactivity_ttl`,
* `connection_timeout`, …). The `motherduck_token` entry is set by this bond.
*/
config?: Record<string, string>
/**
* How long (ms) a query, `connect()` or `transaction()` waits for the single
* connection before failing with an error that says who is holding it.
* Defaults to 30 000.
*/
acquireTimeoutMillis?: number
}
ProcessEnvEnvironment variables consumed by the MotherDuck database provider.
interface ProcessEnv {
MOTHERDUCK_TOKEN?: string
MOTHERDUCK_DATABASE?: string
}
createStore(pool)Creates a DataStore backed by a DuckDB DatabasePool.
function createStore(pool: DatabasePool): DataStore
pool — The DuckDB DatabasePool to use for queries.Returns: A DataStore that translates CRUD operations to DuckDB-compatible SQL.
defaultPoolCreated()Whether the lazy default pool has been created.
Readiness and shutdown wiring must not FORCE a connection.
function defaultPoolCreated(): boolean
Returns: true once the default pool exists.
closeDefaultPool()Close the lazy default pool, if it was created.
function closeDefaultPool(): Promise<void>
Returns: Resolves once the pool has ended.
runMigrationsOn(pool, migrationsDir, options)Apply every migration file in migrationsDir to pool, in lexical order —
the duckdb bond's applyMigrations, unchanged (same ledger, same
translation, same error contract).
function runMigrationsOn(
pool: MigratablePool,
migrationsDir: string,
options?: MigrationOptions,
): Promise<void>
pool — The MotherDuck pool to migrate.migrationsDir — Absolute path to the directory of ordered *.sql files.options — Ledger namespace for multi-directory apps.Returns: Resolves when every file is applied or recorded.
createMigrator(migrationsDir, options)Returns a runMigrations() bound to a migrations directory and the DEFAULT
MotherDuck pool (connection string from MOTHERDUCK_DATABASE).
function createMigrator(migrationsDir: string, options?: MigrationOptions): () => Promise<void>
migrationsDir — Absolute path to the directory of ordered *.sql migration files, resolved from the API package directory.options — A stable namespace for a second SQL directory.Returns: A no-arg runMigrations() that connects to MotherDuck and applies every migration file in lexical order.
chooseConnectionString(config)Resolve the md: connection string: config, then MOTHERDUCK_DATABASE,
then md:.
function chooseConnectionString(config?: MotherduckConfig): string
config — Pool configuration.Returns: The connection string.
resolveToken(config)Resolve the token from config or the env var, lazily — never at import time.
undefined when the caller must fall back to the client's own auto-read of
a lowercase motherduck_token env var.
function resolveToken(config?: MotherduckConfig): string | undefined
config — Pool configuration.Returns: The token, or undefined when nothing is set.
createPool(config)Creates a DatabasePool backed by MotherDuck.
The connection opens on first use, not here, so creating a pool is free and
synchronous. The instance is opened through DuckDBInstance.fromCache —
mandatory per MotherDuck's docs: the Node client does NOT cache instances
by default, and every bare create('md:…') re-fetches the catalog.
function createPool(config?: MotherduckConfig): DatabasePool
config — Connection string, token and wait timeout.Returns: A pool over one long-lived MotherDuck connection.
sqlCapabilitiesWhat the MotherDuck bond supports from PostgreSQL-dialect migrations.
Identical to the DuckDB bond: the engine is the same, so a referential action
(ON DELETE/ON UPDATE CASCADE, SET NULL, SET DEFAULT) is unsupported
and partial indexes are translated without changing behaviour.
const sqlCapabilities: SqlCapabilities
poolThe MotherDuck connection pool instance.
const pool: DatabasePool
storeDefault DataStore proxy backed by the lazily-initialized default pool.
const store: DataStore
DEFAULT_TOKEN_ENVThe env var this bond reads the token from by default.
const DEFAULT_TOKEN_ENV: 'MOTHERDUCK_TOKEN'
databaseMotherduckSecretDefinitionsSecret definitions required by the MotherDuck database bond.
const databaseMotherduckSecretDefinitions: SecretDefinition[]
Implements @molecule/api-database interface.
Setup function to register this provider with the core interface:
import { setPool, setStore } from '@molecule/api-database'
import { pool, store } from '@molecule/api-database-motherduck'
export function setupDatabaseMotherduck(): void {
setPool(pool)
setStore(store)
}
Peer dependencies:
@molecule/api-bond ^1.0.1@molecule/api-database ^1.2.0@molecule/api-database-duckdb ^1.0.0@molecule/api-secrets ^1.0.1MOTHERDUCK_TOKEN (required) — MotherDuck tokeneyJhbGciOi... (the token the UI shows once at creation)MOTHERDUCK_DATABASE (optional) — MotherDuck database — default: md:md:my_db@duckdb/node-api@molecule/api-bond@molecule/api-database@molecule/api-database-duckdb@molecule/api-secretsConfigure via environment variables: MOTHERDUCK_TOKEN (required —
create it in the MotherDuck UI under Settings → "+ Create token"; the
client also auto-reads a lowercase motherduck_token env var by itself)
and MOTHERDUCK_DATABASE (the md: connection string; default md: for
the account's default database, md:my_db for a named one).
config.notConfigured, HTTP 503) naming where to create one — not an
opaque vendor 401. The token is read at first use, never at import time.DuckDBInstance.fromCache), mandatory. The
Node client does not cache md: instances by default and every bare
create() re-fetches the remote catalog; this bond always goes through
the cache, so repeated pools on one connection string share one instance.transaction() holds the queue for
its whole BEGIN → … → COMMIT/ROLLBACK lifetime.INSTALL/LOAD, SET, and temp tables are NOT available
through md: — read_parquet('s3://…') and https:// paths work; a
local ./data.parquet does not (the file is on YOUR disk, not
MotherDuck's).query() (the duckdb
bond's caveat — DuckDB's JSON type is VARCHAR underneath); the
DataStore CRUD helpers parse JSON-typed columns for you._molecule_migrations), same Postgres-dialect translation and the same
limits: partial indexes are translated without changing behaviour, while
an ON DELETE/ON UPDATE referential action throws
UnsupportedSqlFeatureError (DuckDB cannot reproduce it, so the
generator's compatibility preflight refuses that resource/database pair —
see {@link sqlCapabilities}).pool.end() closes this pool's connection. The cached instance stays
alive for the process (MotherDuck's dbinstance_inactivity_ttl, default
15 minutes, retires idle instances server-side).Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.