Skip to content

Commit eadbf25

Browse files
committed
Merge branch 'main' into use_staticlib
# Conflicts: # cgo_static.go # deps/darwin_amd64/libduckdb.a # deps/darwin_arm64/libduckdb.a # deps/linux_amd64/libduckdb.a # deps/linux_arm64/libduckdb.a
2 parents b5967df + 99e7b9c commit eadbf25

Some content is hidden

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

57 files changed

+12040
-2636
lines changed

.github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for GitHub action workflows
4+
- package-ecosystem: github-actions
5+
directory: /
6+
# Check for updates to GitHub Actions every weekday
7+
schedule:
8+
interval: daily
9+
time: "19:00"
10+
open-pull-requests-limit: 10
11+
# Enable version updates for Go modules
12+
- package-ecosystem: gomod
13+
directory: /
14+
# Check for updates to GitHub Actions every weekday
15+
schedule:
16+
interval: daily
17+
time: "20:00"
18+
open-pull-requests-limit: 10

.github/workflows/deps.yaml

+52-34
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
name: Build static library dependencies
22
on:
33
workflow_dispatch:
4-
54
push:
65
branches-ignore:
7-
- master
6+
- main
87
paths:
98
- ".github/workflows/**"
109
- "Makefile"
1110
jobs:
1211
prepare:
13-
runs-on: ubuntu-20.04
14-
steps:
15-
- uses: actions/checkout@v3
16-
with:
17-
ref: ${{ github.head_ref }}
18-
- shell: bash
19-
run: make deps.header
20-
- uses: actions/upload-artifact@v3
21-
with:
22-
name: duckdb_h
23-
path: duckdb.h
24-
retention-days: 1
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.head_ref }}
17+
- shell: bash
18+
run: make deps.header
19+
- uses: actions/upload-artifact@v4
20+
with:
21+
name: duckdb_h
22+
path: duckdb.h
23+
retention-days: 1
2524
darwin_amd64:
2625
needs: prepare
27-
runs-on: macos-latest
26+
runs-on: macos-13
2827
steps:
29-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
3029
with:
3130
ref: ${{ github.head_ref }}
3231
- shell: bash
3332
run: make deps.darwin.amd64
34-
- uses: actions/upload-artifact@v3
33+
- uses: actions/upload-artifact@v4
3534
with:
3635
name: darwin_amd64
3736
path: deps/darwin_amd64/libduckdb.a
@@ -40,12 +39,12 @@ jobs:
4039
needs: prepare
4140
runs-on: macos-latest
4241
steps:
43-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
4443
with:
4544
ref: ${{ github.head_ref }}
4645
- shell: bash
4746
run: make deps.darwin.arm64
48-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4948
with:
5049
name: darwin_arm64
5150
path: deps/darwin_arm64/libduckdb.a
@@ -54,12 +53,12 @@ jobs:
5453
needs: prepare
5554
runs-on: ubuntu-20.04
5655
steps:
57-
- uses: actions/checkout@v3
56+
- uses: actions/checkout@v4
5857
with:
5958
ref: ${{ github.head_ref }}
6059
- shell: bash
6160
run: make deps.linux.amd64
62-
- uses: actions/upload-artifact@v3
61+
- uses: actions/upload-artifact@v4
6362
with:
6463
name: linux_amd64
6564
path: deps/linux_amd64/libduckdb.a
@@ -68,7 +67,7 @@ jobs:
6867
needs: prepare
6968
runs-on: ubuntu-20.04
7069
steps:
71-
- uses: actions/checkout@v3
70+
- uses: actions/checkout@v4
7271
with:
7372
ref: ${{ github.head_ref }}
7473
- name: Install cross compile toolchain
@@ -78,7 +77,7 @@ jobs:
7877
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
7978
- shell: bash
8079
run: make deps.linux.arm64
81-
- uses: actions/upload-artifact@v3
80+
- uses: actions/upload-artifact@v4
8281
with:
8382
name: linux_arm64
8483
path: deps/linux_arm64/libduckdb.a
@@ -87,7 +86,7 @@ jobs:
8786
needs: prepare
8887
runs-on: ubuntu-latest
8988
steps:
90-
- uses: actions/checkout@v3
89+
- uses: actions/checkout@v4
9190
with:
9291
ref: ${{ github.head_ref }}
9392
- uses: vmactions/freebsd-vm@v1
@@ -100,16 +99,30 @@ jobs:
10099
git
101100
102101
run: gmake deps.freebsd.amd64
103-
- uses: actions/upload-artifact@v3
102+
- uses: actions/upload-artifact@v4
104103
with:
105104
name: freebsd_amd64
106105
path: deps/freebsd_amd64/libduckdb.a
107106
retention-days: 1
107+
windows_amd64:
108+
needs: prepare
109+
runs-on: windows-2022
110+
steps:
111+
- uses: actions/checkout@v4
112+
with:
113+
ref: ${{ github.head_ref }}
114+
- shell: bash
115+
run: make deps.windows.amd64
116+
- uses: actions/upload-artifact@v4
117+
with:
118+
name: windows_amd64
119+
path: deps/windows_amd64/libduckdb.a
120+
retention-days: 1
108121
commit:
109122
runs-on: ubuntu-latest
110-
needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, freebsd_amd64]
123+
needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, freebsd_amd64, windows_amd64]
111124
steps:
112-
- uses: actions/checkout@v3
125+
- uses: actions/checkout@v4
113126
with:
114127
ref: ${{ github.head_ref }}
115128
- shell: bash
@@ -119,32 +132,37 @@ jobs:
119132
rm -f deps/linux_amd64/libduckdb.a
120133
rm -f deps/linux_arm64/libduckdb.a
121134
rm -f deps/freebsd_amd64/libduckdb.a
135+
rm -f deps/windows_amd64/libduckdb.a
122136
rm -f duckdb.h
123-
- uses: actions/download-artifact@v3
137+
- uses: actions/download-artifact@v4
124138
with:
125139
name: duckdb_h
126140
path: .
127-
- uses: actions/download-artifact@v3
141+
- uses: actions/download-artifact@v4
128142
with:
129143
name: darwin_amd64
130144
path: deps/darwin_amd64
131-
- uses: actions/download-artifact@v3
145+
- uses: actions/download-artifact@v4
132146
with:
133147
name: darwin_arm64
134148
path: deps/darwin_arm64
135-
- uses: actions/download-artifact@v3
149+
- uses: actions/download-artifact@v4
136150
with:
137151
name: linux_amd64
138152
path: deps/linux_amd64
139-
- uses: actions/download-artifact@v3
153+
- uses: actions/download-artifact@v4
140154
with:
141155
name: linux_arm64
142156
path: deps/linux_arm64
143-
- uses: actions/download-artifact@v3
157+
- uses: actions/download-artifact@v4
144158
with:
145159
name: freebsd_amd64
146160
path: deps/freebsd_amd64
161+
- uses: actions/download-artifact@v4
162+
with:
163+
name: windows_amd64
164+
path: deps/windows_amd64
147165
- name: Push static libraries
148-
uses: stefanzweifel/git-auto-commit-action@v4
166+
uses: stefanzweifel/git-auto-commit-action@v5
149167
with:
150168
commit_message: Re-build static libraries

.github/workflows/golangci-lint.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: golangci-lint
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
golangci:
10+
name: lint
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
15+
with:
16+
go-version: "1.23"
17+
cache: false
18+
- name: golangci-lint
19+
uses: golangci/golangci-lint-action@v6
20+
with:
21+
version: latest
22+

.github/workflows/tests.yaml

+30-13
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,52 @@
11
name: Tests
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
46

57
jobs:
6-
test:
8+
go_test:
79
name: Test
810
runs-on: ${{ matrix.os }}
911
defaults:
1012
run:
1113
shell: bash
12-
1314
strategy:
1415
matrix:
15-
os: [ubuntu-latest, macos-12]
16-
go: ["1.18"]
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
go: ["1.23"]
1718
fail-fast: false
18-
1919
steps:
20-
- uses: actions/setup-go@v2
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-go@v5
2122
with:
2223
go-version: ${{ matrix.go }}
24+
- name: "Run tests"
25+
run: make test
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: test
29+
path: go-duckdb.test.exe
30+
retention-days: 1
2331

24-
- uses: actions/checkout@v2
32+
test_examples:
33+
name: Test examples
34+
runs-on: ubuntu-latest
35+
defaults:
36+
run:
37+
shell: bash
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-go@v5
41+
with:
42+
go-version: ${{ matrix.go }}
43+
- name: "Test examples"
44+
run: make examples
2545

26-
- name: "Run Tests"
27-
run: make test
2846
freebsd_amd64:
2947
runs-on: ubuntu-latest
3048
steps:
31-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
3250
- uses: vmactions/freebsd-vm@v1
3351
with:
3452
usesh: true
@@ -37,5 +55,4 @@ jobs:
3755
gmake \
3856
git \
3957
go
40-
4158
run: gmake test

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
run.sh
44
duckdb/
55
.idea
6+
./duckdb
7+
duckdb

CONTRIBUTING.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
11
# Contributing
22

3+
### Contributions
4+
5+
* Are you fixing a bug or adding a new feature - Great!
6+
* Announce that you are working on an issue by replying to it.
7+
Open a new issue to announce that you are working on a new feature.
8+
* Try to avoid large pull requests - they are much harder to review.
9+
10+
### Pull Requests
11+
12+
* Ensure the PR description clearly describes the problem and solution.
13+
Include the relevant issue number if applicable.
14+
* Add tests to cover your fix or new functionality.
15+
* Pull requests need to pass all continuous integration checks before merging.
16+
* We reserve full and final discretion over whether we merge a pull request or not.
17+
Adhering to these guidelines is not a complete guarantee that your pull request will be merged.
18+
19+
### Testing
20+
21+
`go-duckdb` aims to contain tests that are fast, cover a significant portion of the code,
22+
are comprehensible, and can serve as documentation.
23+
24+
### Go Guidelines
25+
26+
go-duckdb uses [Effective Go](https://go.dev/doc/effective_go) and the
27+
[Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md)
28+
for tips for writing clear, idiomatic Go code. Below are a few excerpts.
29+
30+
* **Error Naming.**
31+
For error values stored as global variables, use the prefix `Err` or `err`.
32+
For custom error types, use the suffix `Error` instead.
33+
* **Commentary.**
34+
Comments for humans are formatted like so: `// Uppercase sentence. Single-space next sentence.`
35+
* **Lines.**
36+
Avoid overly long lines. You can aim to wrap lines that exceed a soft line
37+
length limit of 100 characters.
38+
* **Naming.**
39+
Choose descriptive, concise names. Avoid single-letter variable names.
40+
* Avoid unnecessary interfaces, only export relevant functions.
41+
342
## Upgrading DuckDB
443

544
To upgrade to a new version of DuckDB:
645

7-
1. Create a new branch with the current version number in it. E.g. `v0.9.0`.
8-
2. Change `DUCKDB_VERSION` in `Makefile` to match the version in the branch name.
46+
1. Fork the project and create a new branch.
47+
2. Change `DUCKDB_BRANCH` in the `Makefile` to match the latest DuckDB version, for example `DUCKDB_BRANCH=v0.10.0`.
948
3. Push the updated `Makefile` and create a PR.
10-
4. Wait for Github Actions to pre-compile the static libraries in `deps`. They will be committed automatically to the branch.
11-
5. If everything looks good, the PR will be merged.
49+
4. Wait for GitHub Actions to pre-compile the static libraries in `deps`.
50+
They will be committed automatically to your branch.
51+
5. If everything looks good, we will merge the PR.

0 commit comments

Comments
 (0)