Skip to content

Embed DuckDB extensions in self-packaged binaries (flapi pack --with-extensions) #207

Description

@jrosskopf

Problem

flapi pack produces a single scp-able binary for the config, but its DuckDB extensions are still downloaded at runtime, so the "single file" needs network access to reach any data source.

Proposal

  • flapi pack --with-extensions installs the config's extensions (core_functions, duckdb.default-extensions, INSTALLs in connections.*.init) for the host platform and embeds them under the reserved .flapi/extensions/ prefix; --extensions-dir <dir> embeds an already filled directory (other platforms). Input trees may not use .flapi/.
  • At startup the binary extracts them once to $TMPDIR/flapi-extensions/ext-<content hash>/ (staged + renamed, reused on restart, path-escaping entries refused), drops them from the in-memory bundle map, uses the directory as extension_directory, and starts with offline extensions on. Precedence: config > FLAPI_EXTENSION_DIRECTORY > bundle; FLAPI_EXTENSIONS_OFFLINE=0 overrides.

Requested as part of the extension-bundling decision for the Cloud Run review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions