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: StringExtension 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: StringShort 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: StringInitial 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: StringThe 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: StringPrimary maintainer name: a single non-empty line, quoted and escaped in
description.yml like description.
github_repo: StringGitHub 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: StringValue 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 stampedC_STRUCTand loads into anyDuckDBwhose C API version is at least this. One of:DUCKDB_API_VERSION("v1.2.0"), for an extension that stays off quack-rs’sduckdb-1-5*features. It loads into everyDuckDBfrom v1.2.0, 2.0.0 included.DUCKDB_API_VERSION_1_5_6("v1.5.6"), for one that uses them.DuckDBv1.5.6 and v2.0.0 load it and older releases refuse it. The generatedCargo.tomlpinslibduckdb-systo the v1.5.6 bindings (~1.10506.0), whose layout both releases share, and theMakefilerefuses to build when the resolved bindings are for another release.
true→ an exactDuckDB1.x release, e.g."v1.5.5". The extension is stampedC_STRUCT_UNSTABLEandDuckDBrefuses to load it into any other release. The generatedCargo.tomlthen pinslibduckdb-systo that release’s bindings (~1.10505.0for v1.5.5), theMakefiletests against it (DUCKDB_TEST_VERSION) and refuses to build when the resolved bindings andTARGET_DUCKDB_VERSIONdisagree. A 2.x release is refused:DuckDB2.0 loads aC_STRUCT_UNSTABLEbinary only through the C API v2 entry point, which quack-rs does not generate.
Defaults to DUCKDB_API_VERSION.
use_unstable_c_api: boolWhether 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: StringValue 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
impl Clone for ScaffoldConfig
Source§fn clone(&self) -> ScaffoldConfig
fn clone(&self) -> ScaffoldConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more