Skip to content

strduck v0.2.0

Latest

Choose a tag to compare

@ChronoCoders ChronoCoders released this 13 Jun 00:46

strduck, a DuckDB extension written in Zig.

Scalar functions for VARCHAR:

  • str_reverse(s): reverses a string, preserving UTF-8 codepoints
  • str_count(s, needle): counts non-overlapping occurrences of needle in s
  • str_truncate(s, max_len, ellipsis): truncates s to max_len characters, appending ellipsis when truncated

Each function returns NULL when any argument is NULL.

Changes since v0.1.0:

  • Added edge-case tests for multibyte UTF-8, non-overlapping counts, and truncation boundaries
  • Prebuilt binaries for all five supported platforms

Built for DuckDB 1.2. Prebuilt binaries attached for:

  • linux_amd64_gcc4
  • linux_arm64_gcc4
  • osx_arm64
  • windows_amd64
  • windows_arm64

Load one in a DuckDB session started with -unsigned:

LOAD 'strduck.duckdb_extension';

To build for another platform, run zig build -Dduckdb-version=1.2.0 -Dplatform=.