@terascope/data-mate / teal-frame/extensions
teal-frame/extensions
Interfaces
| Interface | Description |
|---|---|
| DuckExtension | The DuckDB extensions a frame needs, and how the database loads them. |
| ExtensionSettings | - |
Variables
AUTOINSTALL_EXTENSIONS_ENV
constAUTOINSTALL_EXTENSIONS_ENV:"DUCKDB_AUTOINSTALL_EXTENSIONS"='DUCKDB_AUTOINSTALL_EXTENSIONS'
Defined in: data-mate/src/teal-frame/extensions.ts:66
Set to false in an image, so a missing extension fails at startup instead of downloading.
EXTENSION_DIRECTORY_ENV
constEXTENSION_DIRECTORY_ENV:"DUCKDB_EXTENSION_DIRECTORY"='DUCKDB_EXTENSION_DIRECTORY'
Defined in: data-mate/src/teal-frame/extensions.ts:63
Where the extensions live. Unset means DuckDB's default, ~/.duckdb/extensions.
REQUIRED_EXTENSIONS
constREQUIRED_EXTENSIONS: readonlyDuckExtension[]
Defined in: data-mate/src/teal-frame/extensions.ts:26
STATIC_EXTENSIONS
constSTATIC_EXTENSIONS: readonlystring[]
Defined in: data-mate/src/teal-frame/extensions.ts:60
Extensions compiled into the binding, which must never be installed: INSTALL parquet
downloads a copy that shadows the built-in one and makes duckdb_extensions() misreport it.
install checks they are still compiled in, so a DuckDB upgrade that drops one fails the build.
Functions
extensionSettingsFromEnv()
extensionSettingsFromEnv(
env?):ExtensionSettings
Defined in: data-mate/src/teal-frame/extensions.ts:80
Reads the extension settings from the environment.
They are read from the environment, not only from configureDuckDatabase, because the
database may be opened by a frame before any configuration runs, and the directory must be
correct from the moment it opens.
Parameters
| Parameter | Type | Default value |
|---|---|---|
env | ProcessEnv | process.env |
Returns
firstLine()
firstLine(
err):string
Defined in: data-mate/src/teal-frame/extensions.ts:154
Parameters
| Parameter | Type |
|---|---|
err | unknown |
Returns
string
loadExtensions()
loadExtensions(
connection,autoinstall):Promise<void>
Defined in: data-mate/src/teal-frame/extensions.ts:109
Loads every required extension and throws one error naming all that are missing.
With autoinstall on (the default, used in local development) a missing extension is installed first, once per machine. With it off (in an image) nothing uses the network. Loading an already-loaded extension is cheap, so calling this again is harmless.
Parameters
| Parameter | Type |
|---|---|
connection | DuckDBConnection |
autoinstall | boolean |
Returns
Promise<void>