Skip to content

Commit db4a028

Browse files
joseph-isaacs0ax1
authored andcommitted
v0.0.1
0 parents  commit db4a028

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2037
-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: 'recursive'
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/[email protected]
47+
with:
48+
vcpkgGitCommitId: 5e5d0e1cd7785623065e77eff011afdeec1a3574
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: 'recursive'
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/[email protected]
100+
with:
101+
vcpkgGitCommitId: 5e5d0e1cd7785623065e77eff011afdeec1a3574
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: 'recursive'
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/[email protected]
149+
with:
150+
vcpkgGitCommitId: 5e5d0e1cd7785623065e77eff011afdeec1a3574
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
duckdb-stable-build:
14+
name: Build extension binaries
15+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@6a7a4f24c5999355ab36c0a6835baf891fc9d522
16+
with:
17+
duckdb_version: v1.2.2
18+
ci_tools_version: 6a7a4f24c5999355ab36c0a6835baf891fc9d522
19+
extension_name: vortex
20+
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64_mingw;windows_amd64;linux_arm64"
21+
extra_toolchains: "rust"
22+
override_ci_tools_repository: spiraldb/extension-ci-tools

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
build
2+
.idea
3+
cmake-build-debug
4+
duckdb_unittest_tempdir/
5+
.DS_Store
6+
testext
7+
test/python/__pycache__/
8+
.Rhistory
9+
compile_commands.json
10+
11+
#proto gen folder
12+
gen/

.gitmodules

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[submodule "extension-ci-tools"]
2+
path = extension-ci-tools
3+
url = https://github.com/duckdb/extension-ci-tools
4+
branch = main
5+
[submodule "vortex"]
6+
path = vortex
7+
url = https://github.com/spiraldb/vortex
8+
branch = main
9+
[submodule "duckdb"]
10+
path = duckdb
11+
url = https://github.com/spiraldb/duckdb.git
12+
[submodule "vcpkg"]
13+
path = vcpkg
14+
url = [email protected]:microsoft/vcpkg.git

CMakeLists.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
cmake_minimum_required(VERSION 3.22)
2+
3+
set(TARGET_NAME vortex)
4+
project(${TARGET_NAME}_project)
5+
6+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
7+
set(CMAKE_CXX_STANDARD 17)
8+
9+
include(FetchContent)
10+
FetchContent_Declare(
11+
Corrosion
12+
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
13+
GIT_TAG v0.5.2
14+
)
15+
16+
FetchContent_MakeAvailable(Corrosion)
17+
18+
find_package(Catch2 CONFIG REQUIRED)
19+
find_package(Protobuf CONFIG REQUIRED)
20+
if (APPLE)
21+
find_library(SECURITY_FRAMEWORK Security)
22+
endif ()
23+
24+
corrosion_import_crate(MANIFEST_PATH vortex/Cargo.toml
25+
CRATES vortex-ffi
26+
FEATURES duckdb
27+
IMPORTED_CRATES vortex_ffi
28+
)
29+
30+
set(EXTENSION_NAME ${TARGET_NAME}_extension)
31+
set(EXTENSION_SOURCES src/vortex_extension.cpp src/expr/expr.cpp src/vortex_write.cpp src/vortex_scan.cpp)
32+
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
33+
34+
# Generate C++ code from .proto files.
35+
file(GLOB PROTO_FILES "vortex/vortex-proto/proto/*.proto")
36+
set(PROTO_GEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gen)
37+
file(MAKE_DIRECTORY ${PROTO_GEN_DIR})
38+
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES} PROTOC_OUT_DIR ${PROTO_GEN_DIR})
39+
40+
include_directories(src/include ${PROTO_GEN_DIR} vortex/vortex-ffi/cinclude)
41+
42+
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES} ${PROTO_SRCS})
43+
build_loadable_extension(${TARGET_NAME} ${EXTENSION_SOURCES} ${PROTO_SRCS})
44+
45+
target_link_libraries(${EXTENSION_NAME}
46+
vortex_ffi-static
47+
protobuf::libprotobuf
48+
${SECURITY_FRAMEWORK}
49+
)
50+
target_link_libraries(${LOADABLE_EXTENSION_NAME}
51+
vortex_ffi-shared
52+
protobuf::libprotobuf
53+
${SECURITY_FRAMEWORK}
54+
)
55+
56+
add_subdirectory(test)
57+
58+
install(
59+
TARGETS ${EXTENSION_NAME}
60+
EXPORT "${DUCKDB_EXPORT_SET}"
61+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
62+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
63+
)

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2+
3+
EXT_NAME=vortex_duckdb
4+
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
5+
EXT_FLAGS=-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DOVERRIDE_GIT_DESCRIBE=v1.2.2
6+
7+
export MACOSX_DEPLOYMENT_TARGET=12.0
8+
export VCPKG_OSX_DEPLOYMENT_TARGET=12.0
9+
export VCPKG_FEATURE_FLAGS=-binarycaching
10+
export VCPKG_TOOLCHAIN_PATH := ${PROJ_DIR}vcpkg/scripts/buildsystems/vcpkg.cmake
11+
12+
include extension-ci-tools/makefiles/duckdb_extension.Makefile

0 commit comments

Comments
 (0)