{"id":33289525,"url":"https://github.com/habedi/template-duckdb-extension-zig","last_synced_at":"2026-05-08T03:32:14.244Z","repository":{"id":324778528,"uuid":"1073176254","full_name":"habedi/template-duckdb-extension-zig","owner":"habedi","description":"A template for developing DuckDB extensions in Zig","archived":false,"fork":false,"pushed_at":"2025-11-17T19:35:13.000Z","size":212,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-17T21:19:29.124Z","etag":null,"topics":["c","duckdb","duckdb-extension","quality-of-life","template-project","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/habedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["habedi"]}},"created_at":"2025-10-09T18:13:28.000Z","updated_at":"2025-10-16T12:19:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/habedi/template-duckdb-extension-zig","commit_stats":null,"previous_names":["habedi/template-duckdb-extension-zig"],"tags_count":1,"template":true,"template_full_name":"habedi/template-zig-project","purl":"pkg:github/habedi/template-duckdb-extension-zig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-duckdb-extension-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-duckdb-extension-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-duckdb-extension-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-duckdb-extension-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/habedi","download_url":"https://codeload.github.com/habedi/template-duckdb-extension-zig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Ftemplate-duckdb-extension-zig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32765279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","duckdb","duckdb-extension","quality-of-life","template-project","zig"],"created_at":"2025-11-17T22:01:31.228Z","updated_at":"2026-05-08T03:32:14.222Z","avatar_url":"https://github.com/habedi.png","language":"Zig","funding_links":["https://github.com/sponsors/habedi"],"categories":["Extensions"],"sub_categories":["Other Extensions"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg alt=\"Project Logo\" src=\"logo.svg\" height=\"20%\" width=\"20%\"\u003e\n  \u003c/picture\u003e\n\u003cbr\u003e\n\n\u003ch2\u003eDuckDB Extension Template for Zig\u003c/h2\u003e\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/habedi/template-duckdb-extension-zig/tests.yml?label=tests\u0026style=flat\u0026labelColor=282c34\u0026logo=github)](https://github.com/habedi/template-duckdb-extension-zig/actions/workflows/tests.yml)\n[![CodeFactor](https://img.shields.io/codefactor/grade/github/habedi/template-duckdb-extension-zig?label=code%20quality\u0026style=flat\u0026labelColor=282c34\u0026logo=codefactor)](https://www.codefactor.io/repository/github/habedi/template-duckdb-extension-zig)\n[![Zig Version](https://img.shields.io/badge/Zig-0.15.2-orange?logo=zig\u0026labelColor=282c34)](https://ziglang.org/download/)\n[![Release](https://img.shields.io/github/release/habedi/template-duckdb-extension-zig.svg?label=release\u0026style=flat\u0026labelColor=282c34\u0026logo=github)](https://github.com/habedi/template-duckdb-extension-zig/releases/latest)\n[![License](https://img.shields.io/badge/license-MIT-007ec6?label=license\u0026style=flat\u0026labelColor=282c34\u0026logo=open-source-initiative)](https://github.com/habedi/template-duckdb-extension-zig/blob/main/LICENSE)\n\nA template for creating DuckDB extensions in Zig\n\n\u003c/div\u003e\n\n---\n\nThis is a DuckDB extension template for Zig that provides a starting point for creating DuckDB extensions in Zig\nprogramming language.\nIt uses the DuckDB's extension API ([C version](https://github.com/duckdb/extension-template-c/tree/main/duckdb_capi))\nand supports multi-platform builds using Zig's cross-compilation features.\n\nI'm sharing this template here in case it can be useful to others.\n\n### Features\n\n- All build tasks can be managed using `build.zig` or `Makefile` (if you prefer GNU Make)\n- Built-in support for cross-compilation (for Linux, macOS, and Windows; ARM and AMD)\n- Very fast builds; no need to build DuckDB from source\n- Built extensions are version-agnostic and work with DuckDB 1.2.0 and later\n\n\u003e [!IMPORTANT]\n\u003e The template is in early development, so bugs and breaking API changes are expected.\n\u003e Please use the [issues page](https://github.com/habedi/template-duckdb-extension-zig/issues) to report bugs or request\n\u003e features.\n\n---\n\n### Getting Started\n\n#### Prerequisites\n\n- Zig 0.15.2\n- Python 3\n- DuckDB 1.2.0 or later (recommended for testing the extension)\n- GNU Make (optional, for convenience)\n- A C compiler\n- Git\n\n#### Quick Start\n\n1. **Clone the repository with submodules:**\n   ```bash\n   git clone --recursive https://github.com/habedi/template-duckdb-extension-zig.git\n   cd template-duckdb-extension-zig\n   ```\n\n2. **Configure your extension name (optional):**\n\n   The template uses \"extension\" as the default name. To use your own name, either:\n\n    - Set it in the Makefile:\n      ```makefile\n      EXTENSION_NAME ?= my_custom_extension\n      ```\n\n    - Or pass it as a parameter:\n      ```bash\n      make build-all EXTENSION_NAME=my_custom_extension\n      ```\n\n    - Or use zig build directly:\n      ```bash\n      zig build build-all -Dextension-name=my_custom_extension\n      ```\n\n3. **Build the extension:**\n   ```bash\n   make build-all\n   # Or with a custom name:\n   make build-all EXTENSION_NAME=my_custom_extension\n   ```\n\n4. **Run tests:**\n   ```bash\n   zig build test\n   zig build test-extension -Dextension-name=my_custom_extension\n   ```\n\n5. **Try it interactively:**\n   ```bash\n   zig build duckdb -Dextension-name=my_custom_extension\n   ```\n\n#### Configuration Variables\n\nThe build system supports several configurable variables:\n\n- `EXTENSION_NAME` - Name of the extension (default: \"extension\")\n- `EXTENSION_API_VERSION` - DuckDB Extension API version (default: \"v1.2.0\"; normally you don't need to change this)\n- `EXTENSION_VERSION` - Your extension version (default: \"v1.0.0\")\n- `PLATFORM` - Target platform (default: auto-detected)\n\nExample:\n\n```bash\nmake build-all \\\n  EXTENSION_NAME=my_extension \\\n  EXTENSION_API_VERSION=v1.2.0 \\\n  EXTENSION_VERSION=v2.0.0\n```\n\nFor GitHub Actions, update the environment variables in `.github/workflows/builds.yml`:\n\n```yaml\nenv:\n    EXTENSION_NAME: my_custom_extension\n    EXTENSION_API_VERSION: v1.2.0\n    EXTENSION_VERSION: v1.0.0\n```\n\n#### Available Commands\n\nAll build tasks are managed through `zig build` or `make`:\n\n- `make build` or `zig build` - Build the extension\n- `make build-all` or `zig build build-all` - Build with DuckDB metadata added to the extension\n- `make test` or `zig build test` - Run unit tests\n- `make test-extension` or `zig build test-extension` - Test with DuckDB\n- `zig build duckdb` - Start an interactive DuckDB session (with the extension loaded)\n- `make clean` or `zig build clean` - Clean build artifacts and unnecessary files\n- `zig build docs` - Generate documentation (Zig API docs)\n- `make build-all-platforms` - Build for all supported platforms (OSes and hardware architectures)\n\n---\n\n### Documentation\n\n- **API Documentation** - Run `zig build docs` and open `docs/api/index.html`\n\n#### Project Structure\n\n```\n├── build.zig             # Zig build configuration\n├── Makefile              # Wrapper around `zig build` that extends its functionality (optional)\n├── src/\n│   ├── lib.zig           # Main extension code\n│   ├── lib_test.zig      # Unit tests for the extension\n│   ├── extension.c       # C entry point for the extension\n│   └── duckdb.zig        # DuckDB extension API (translated to Zig from C)\n└── external/             # External depencies like Git submodules (extension API)\n```\n\n---\n\n### Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to make a contribution.\n\n### License\n\nThis project is licensed under the MIT License ([LICENSE](LICENSE) or https://opensource.org/license/MIT).\n\n### Acknowledgements\n\n* The logo is from [SVG Repo](https://www.svgrepo.com/svg/117247/duck-footprints) with some modifications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabedi%2Ftemplate-duckdb-extension-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhabedi%2Ftemplate-duckdb-extension-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabedi%2Ftemplate-duckdb-extension-zig/lists"}