Skip to content

Commit 6113ed3

Browse files
authored
Initial commit
0 parents  commit 6113ed3

23 files changed

+934
-0
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
duckdb/.clang-format

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
duckdb/.clang-tidy

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
duckdb/.editorconfig
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#
2+
# NOTE: this workflow is for testing the extension template itself,
3+
# this workflow will be removed when scripts/bootstrap-template.py is run
4+
#
5+
name: Extension Template
6+
on: [push, pull_request,repository_dispatch]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
linux:
13+
name: Linux
14+
if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }}
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
# Add commits/tags to build against other DuckDB versions
19+
duckdb_version: [ '<submodule_version>' ]
20+
env:
21+
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
22+
VCPKG_TARGET_TRIPLET: 'x64-linux'
23+
GEN: ninja
24+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
25+
defaults:
26+
run:
27+
shell: bash
28+
29+
steps:
30+
- name: Install Ninja
31+
shell: bash
32+
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build
33+
34+
- uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
submodules: 'true'
38+
39+
- name: Checkout DuckDB to version
40+
if: ${{ matrix.duckdb_version != '<submodule_version>'}}
41+
run: |
42+
cd duckdb
43+
git checkout ${{ matrix.duckdb_version }}
44+
45+
- name: Setup vcpkg
46+
uses: lukka/run-vcpkg@v11.1
47+
with:
48+
vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b
49+
50+
- name: Rename extension
51+
run: |
52+
python3 scripts/bootstrap-template.py ext_1_a_123b_b11
53+
54+
- name: Build
55+
run: |
56+
make
57+
58+
- name: Test
59+
run: |
60+
make test
61+
62+
macos:
63+
name: MacOS
64+
if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }}
65+
runs-on: macos-latest
66+
strategy:
67+
matrix:
68+
# Add commits/tags to build against other DuckDB versions
69+
duckdb_version: [ '<submodule_version>']
70+
env:
71+
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
72+
VCPKG_TARGET_TRIPLET: 'x64-osx'
73+
OSX_BUILD_ARCH: 'x86_64'
74+
GEN: ninja
75+
defaults:
76+
run:
77+
shell: bash
78+
79+
steps:
80+
- uses: actions/checkout@v4
81+
with:
82+
fetch-depth: 0
83+
submodules: 'true'
84+
85+
- name: Install Ninja
86+
run: brew install ninja
87+
88+
- uses: actions/setup-python@v2
89+
with:
90+
python-version: '3.11'
91+
92+
- name: Checkout DuckDB to version
93+
if: ${{ matrix.duckdb_version != '<submodule_version>'}}
94+
run: |
95+
cd duckdb
96+
git checkout ${{ matrix.duckdb_version }}
97+
98+
- name: Setup vcpkg
99+
uses: lukka/run-vcpkg@v11.1
100+
with:
101+
vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b
102+
103+
- name: Rename extension
104+
run: |
105+
python scripts/bootstrap-template.py ext_1_a_123b_b11
106+
107+
- name: Build
108+
run: |
109+
make
110+
111+
- name: Test
112+
run: |
113+
make test
114+
115+
windows:
116+
name: Windows
117+
if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }}
118+
runs-on: windows-latest
119+
strategy:
120+
matrix:
121+
# Add commits/tags to build against other DuckDB versions
122+
duckdb_version: [ '<submodule_version>' ]
123+
env:
124+
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
125+
VCPKG_TARGET_TRIPLET: 'x64-windows-static-md'
126+
defaults:
127+
run:
128+
shell: bash
129+
130+
steps:
131+
- uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
134+
submodules: 'true'
135+
136+
- uses: actions/setup-python@v2
137+
with:
138+
python-version: '3.11'
139+
140+
- name: Checkout DuckDB to version
141+
# Add commits/tags to build against other DuckDB versions
142+
if: ${{ matrix.duckdb_version != '<submodule_version>'}}
143+
run: |
144+
cd duckdb
145+
git checkout ${{ matrix.duckdb_version }}
146+
147+
- name: Setup vcpkg
148+
uses: lukka/run-vcpkg@v11.1
149+
with:
150+
vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b
151+
152+
- name: Rename extension
153+
run: |
154+
python scripts/bootstrap-template.py ext_1_a_123b_b11
155+
156+
- name: Build
157+
run: |
158+
make
159+
160+
- name: Test extension
161+
run: |
162+
build/release/test/Release/unittest.exe
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# This workflow calls the main distribution pipeline from DuckDB to build, test and (optionally) release the extension
3+
#
4+
name: Main Extension Distribution Pipeline
5+
on:
6+
push:
7+
pull_request:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' && github.sha || '' }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
duckdb-stable-build:
16+
name: Build extension binaries
17+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.4.1
18+
with:
19+
duckdb_version: v1.4.1
20+
ci_tools_version: v1.4.1
21+
extension_name: quack
22+
23+
code-quality-check:
24+
name: Code Quality Check
25+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@v1.4.1
26+
with:
27+
duckdb_version: v1.4.1
28+
ci_tools_version: v1.4.1
29+
extension_name: quack
30+
format_checks: 'format;tidy'

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build
2+
.idea
3+
cmake-build-debug
4+
duckdb_unittest_tempdir/
5+
.DS_Store
6+
testext
7+
test/python/__pycache__/
8+
.Rhistory

.gitmodules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[submodule "duckdb"]
2+
path = duckdb
3+
url = https://github.com/duckdb/duckdb
4+
branch = main
5+
[submodule "extension-ci-tools"]
6+
path = extension-ci-tools
7+
url = https://github.com/duckdb/extension-ci-tools
8+
branch = main

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
# Set extension name here
4+
set(TARGET_NAME quack)
5+
6+
# DuckDB's extension distribution supports vcpkg. As such, dependencies can be added in ./vcpkg.json and then
7+
# used in cmake with find_package. Feel free to remove or replace with other dependencies.
8+
# Note that it should also be removed from vcpkg.json to prevent needlessly installing it..
9+
find_package(OpenSSL REQUIRED)
10+
11+
set(EXTENSION_NAME ${TARGET_NAME}_extension)
12+
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
13+
14+
project(${TARGET_NAME})
15+
include_directories(src/include)
16+
17+
set(EXTENSION_SOURCES src/quack_extension.cpp)
18+
19+
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
20+
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
21+
22+
# Link OpenSSL in both the static library as the loadable extension
23+
target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
24+
target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
25+
26+
install(
27+
TARGETS ${EXTENSION_NAME}
28+
EXPORT "${DUCKDB_EXPORT_SET}"
29+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
30+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2018-2025 Stichting DuckDB Foundation
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2+
3+
# Configuration of extension
4+
EXT_NAME=quack
5+
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
6+
7+
# Include the Makefile from extension-ci-tools
8+
include extension-ci-tools/makefiles/duckdb_extension.Makefile

0 commit comments

Comments
 (0)