forked from wolfi-dev/os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
duckdb.yaml
87 lines (79 loc) · 2.58 KB
/
duckdb.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package:
name: duckdb
version: 1.1.3
epoch: 0
description: "DuckDB is an analytical in-process SQL database management system"
copyright:
- license: MIT
environment:
contents:
packages:
- autoconf
- automake
- build-base
- ca-certificates-bundle
- cmake
- git
- ninja
- openssl-dev
- wolfi-base
pipeline:
- uses: git-checkout
with:
repository: https://github.com/duckdb/duckdb
tag: v${{package.version}}
expected-commit: 19864453f7d0ed095256d848b46e7b8630989bac
- uses: autoconf/make
with:
opts: |
GEN=ninja CORE_EXTENSIONS='autocomplete;httpfs;icu;json;tpch;delta'
- runs: install -Dm755 build/release/duckdb "${{targets.destdir}}"/usr/bin/duckdb
- uses: strip
subpackages:
- name: "${{package.name}}-compat"
description: "Compatibility package to place binaries in the location expected by upstream image"
pipeline:
- runs: |
mkdir -p "${{targets.contextdir}}"
ln -sf /usr/bin/duckdb ${{targets.contextdir}}/duckdb
test:
pipeline:
- runs: |
test -L /duckdb
update:
enabled: true
github:
identifier: duckdb/duckdb
strip-prefix: v
use-tag: true
test:
pipeline:
- name: Ensure CLI is operational
runs: |
duckdb --version
- name: Open and query in-memory database
runs: |
echo "SELECT 'quack' AS response;" | duckdb :memory: | grep -qi "quack"
- name: Create and query persistent database
runs: |
duckdb test.duckdb "CREATE TABLE test (id INTEGER, name TEXT); INSERT INTO test VALUES (1, 'Alice'), (2, 'Bob');"
duckdb test.duckdb "SELECT name FROM test WHERE id=2;" | grep -qi "Bob"
- name: Test dot commands
runs: |
echo ".mode csv" > dot_commands.sql
echo "SELECT 'duck' AS bird;" >> dot_commands.sql
duckdb :memory: ".read dot_commands.sql" | grep -qi "duck"
- name: Export query results to a file
runs: |
duckdb :memory: "SELECT 1 AS id, 'test' AS name;" > output.csv
grep -qi "test" output.csv
- name: Validate piping data
runs: |
echo "1,duck" > input.csv
duckdb -c "CREATE TABLE test (id INTEGER, name TEXT); COPY test FROM 'input.csv' (FORMAT 'csv', HEADER FALSE); SELECT * FROM test;" | grep -qi "duck"
- name: Validate environment variable access
runs: |
echo "SELECT getenv('HOME') AS home_dir;" | duckdb :memory: | grep -q "/"
- name: Load and test an extension
runs: |
duckdb :memory: "INSTALL fts; LOAD fts; SELECT 1;" | grep -q "1"