@haybarn/ext-clamp-h1-5-3
v202604.26.135353
Published
Provides mathematical clamp functions for numeric types in DuckDB, including general clamping, saturate, and others. Ensures values stay within a specified range and handles NULLs and NaNs correctly.
Maintainers
Readme
Haybarn extension: clamp
Provides mathematical clamp functions for numeric types in DuckDB, including general clamping, saturate, and others. Ensures values stay within a specified range and handles NULLs and NaNs correctly.
Source: https://github.com/oglego/duckdb_clamp
Catalog: Haybarn community extensions
Install
npm install @haybarn/ext-clamp-h1-5-3
# or use the exact version:
npm install @haybarn/[email protected]npm picks the matching platform binary from the leaves below via its os / cpu / libc fields. No postinstall scripts, no network calls after npm install.
Available platforms (this version)
Installed automatically by npm install @haybarn/ext-clamp-h1-5-3 (npm picks the one matching your os/cpu/libc):
@haybarn/ext-clamp-h1-5-3-linux-arm64@haybarn/ext-clamp-h1-5-3-linux-x64@haybarn/ext-clamp-h1-5-3-win32-x64@haybarn/ext-clamp-h1-5-3-darwin-x64@haybarn/ext-clamp-h1-5-3-darwin-arm64
WebAssembly (duckdb-wasm)
Also built for duckdb-wasm. These are not installed by the meta above (npm has no wasm os/cpu to match) — install the variant matching your duckdb-wasm bundle (mvp / eh / threads) and point duckdb-wasm at the bundled asset:
@haybarn/ext-clamp-h1-5-3-wasm-threads@haybarn/ext-clamp-h1-5-3-wasm-eh@haybarn/ext-clamp-h1-5-3-wasm-mvp
npm install @haybarn/ext-clamp-h1-5-3-wasm-threadsimport extUrl from '@haybarn/ext-clamp-h1-5-3-wasm-threads/bin/clamp.duckdb_extension.wasm?url';
await conn.query(`INSTALL clamp FROM '${extUrl}'`);
await conn.query(`LOAD clamp`);Use it
Once installed, the .duckdb_extension binary lands in your project's node_modules/ tree under the matching leaf. The Haybarn engine auto-discovers it at startup; from a Haybarn SQL session:
LOAD clamp;License
The clamp extension is distributed under MIT. The Haybarn engine itself is MIT-licensed.
Trademark
Haybarn is an independent derived distribution of DuckDB published by Query Farm LLC. Not affiliated with or endorsed by the DuckDB Foundation. DuckDB is a trademark of the DuckDB Foundation.
