Skip to main content

ScaffoldConfig

Struct ScaffoldConfig 

Source
pub struct ScaffoldConfig {
    pub name: String,
    pub description: String,
    pub version: String,
    pub license: String,
    pub maintainer: String,
    pub github_repo: String,
    pub excluded_platforms: Vec<String>,
    pub target_duckdb_version: String,
    pub use_unstable_c_api: bool,
    pub git_ref: String,
}
Expand description

Configuration for generating a new extension project.

Fields§

§name: String

Extension name (must pass validate_community_extension_name: well formed, and not a DuckDB alias such as s3 or a core extension name such as json).

§description: String

Short description of the extension.

Free text: YAML punctuation such as : or #, quotes, backslashes and non-ASCII text are quoted and escaped in description.yml, and each line becomes a //! line in src/lib.rs. It must not be empty, start or end with whitespace, or contain control characters other than newline and tab (or Unicode bidirectional controls).

§version: String

Initial version: semver without a leading v (e.g. "0.1.0"), because it is the [package] version of the generated Cargo.toml (and cargo refuses anything else) as well as the version in description.yml. Must pass validate_semver, with every numeric part at most u64::MAX (what Cargo can read).

§license: String

The license: an SPDX identifier or expression such as MIT OR Apache-2.0. One that validate_spdx_license accepts is used as is; a well-formed one naming an identifier outside its shortlist (BUSL-1.1, CC0-1.0) is accepted with a warning, since the shortlist is not the SPDX registry. Line breaks and other whitespace are written as single spaces.

The scaffold writes the license text for MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, MIT-0 and Unlicense (LICENSE, or LICENSE-<ID> for each in an expression), and a LICENSE.TODO naming the text to add for anything else.

§maintainer: String

Primary maintainer name: a single non-empty line, quoted and escaped in description.yml like description.

§github_repo: String

GitHub repository path (e.g., "myorg/duckdb-my-ext"): owner/repo, in the characters GitHub allows.

§excluded_platforms: Vec<String>

Platforms the community build skips: written as excluded_platforms in description.yml and as exclude_archs in the generated distribution workflow, so the two always agree.

Defaults to DEFAULT_EXCLUDED_PLATFORMS; an empty list builds for every platform.

§target_duckdb_version: String

Value written as TARGET_DUCKDB_VERSION in the generated Makefile.

extension-ci-tools passes this to append_extension_metadata.py -dv, and its meaning depends on use_unstable_c_api:

  • false → the C extension API version. The extension is stamped C_STRUCT and loads into any DuckDB whose C API version is at least this. One of:
    • DUCKDB_API_VERSION ("v1.2.0"), for an extension that stays off quack-rs’s duckdb-1-5* features. It loads into every DuckDB from v1.2.0, 2.0.0 included.
    • DUCKDB_API_VERSION_1_5_6 ("v1.5.6"), for one that uses them. DuckDB v1.5.6 and v2.0.0 load it and older releases refuse it. The generated Cargo.toml pins libduckdb-sys to the v1.5.6 bindings (~1.10506.0), whose layout both releases share, and the Makefile refuses to build when the resolved bindings are for another release.
  • true → an exact DuckDB 1.x release, e.g. "v1.5.5". The extension is stamped C_STRUCT_UNSTABLE and DuckDB refuses to load it into any other release. The generated Cargo.toml then pins libduckdb-sys to that release’s bindings (~1.10505.0 for v1.5.5), the Makefile tests against it (DUCKDB_TEST_VERSION) and refuses to build when the resolved bindings and TARGET_DUCKDB_VERSION disagree. A 2.x release is refused: DuckDB 2.0 loads a C_STRUCT_UNSTABLE binary only through the C API v2 entry point, which quack-rs does not generate.

Defaults to DUCKDB_API_VERSION.

§use_unstable_c_api: bool

Whether the generated Makefile sets USE_UNSTABLE_C_API=1, pinning the binary to one DuckDB 1.x release.

An extension that enables quack-rs’s duckdb-1-5, duckdb-1-5-3 or duckdb-1-5-4 features calls C API functions past the stable prefix of duckdb_ext_api_v1, so DuckDB must not load it into a release with a different layout (see crate::abi). The way to ensure that which also works on DuckDB 2.0 is to leave this false and set target_duckdb_version to DUCKDB_API_VERSION_1_5_6. Set this only to target one release older than v1.5.6.

Defaults to false.

§git_ref: String

Value written as repo.ref in the generated description.yml.

Must be a commit hash, not a branch. DuckDB’s community-extension documentation is explicit — “Provide the hash of the latest commit on the branch targeting stable as ref” — because the repository builds exactly this revision and signs the result, so a moving reference would make the build unreproducible. Of the 395 description.yml files in duckdb/community-extensions at commit 845779e, 384 pin a full 40-character hash and 11 a tag; none uses a branch. Letters, digits, -, _, . and / only.

Defaults to REF_PLACEHOLDER, which is deliberately not a valid revision so it cannot be submitted by accident.

Trait Implementations§

Source§

impl Clone for ScaffoldConfig

Source§

fn clone(&self) -> ScaffoldConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScaffoldConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScaffoldConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.