Skip to content

Commit bff06ed

Browse files
authored
Merge pull request #75 from frectonz/duckdb-on-musl
duckdb-on-musl
2 parents 24aa881 + 2745b0e commit bff06ed

7 files changed

Lines changed: 21 additions & 59 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ jobs:
6464
# we specify bash to get pipefail; it guards against the `curl` command
6565
# failing. otherwise `sh` won't catch that `curl` returned non-0
6666
shell: bash
67-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.4/cargo-dist-installer.sh | sh"
67+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.32.0/cargo-dist-installer.sh | sh"
6868
- name: Cache dist
69-
uses: actions/upload-artifact@v6
69+
uses: actions/upload-artifact@v7
7070
with:
7171
name: cargo-dist-cache
7272
path: ~/.cargo/bin/dist
@@ -82,7 +82,7 @@ jobs:
8282
cat plan-dist-manifest.json
8383
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8484
- name: "Upload dist-manifest.json"
85-
uses: actions/upload-artifact@v6
85+
uses: actions/upload-artifact@v7
8686
with:
8787
name: artifacts-plan-dist-manifest
8888
path: plan-dist-manifest.json
@@ -104,7 +104,7 @@ jobs:
104104
npm install
105105
npm run build
106106
- name: Upload UI build
107-
uses: actions/upload-artifact@v6
107+
uses: actions/upload-artifact@v7
108108
with:
109109
name: ui-dist
110110
path: ui/dist/
@@ -154,7 +154,7 @@ jobs:
154154
run: ${{ matrix.install_dist.run }}
155155
# Get the dist-manifest
156156
- name: Fetch local artifacts
157-
uses: actions/download-artifact@v7
157+
uses: actions/download-artifact@v8
158158
with:
159159
pattern: artifacts-*
160160
path: target/distrib/
@@ -163,7 +163,7 @@ jobs:
163163
run: |
164164
${{ matrix.packages_install }}
165165
- name: Download pre-built UI
166-
uses: actions/download-artifact@v7
166+
uses: actions/download-artifact@v8
167167
with:
168168
name: ui-dist
169169
path: ui/dist/
@@ -186,7 +186,7 @@ jobs:
186186
187187
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
188188
- name: "Upload artifacts"
189-
uses: actions/upload-artifact@v6
189+
uses: actions/upload-artifact@v7
190190
with:
191191
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
192192
path: |
@@ -208,14 +208,14 @@ jobs:
208208
persist-credentials: false
209209
submodules: recursive
210210
- name: Install cached dist
211-
uses: actions/download-artifact@v7
211+
uses: actions/download-artifact@v8
212212
with:
213213
name: cargo-dist-cache
214214
path: ~/.cargo/bin/
215215
- run: chmod +x ~/.cargo/bin/dist
216216
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
217217
- name: Fetch local artifacts
218-
uses: actions/download-artifact@v7
218+
uses: actions/download-artifact@v8
219219
with:
220220
pattern: artifacts-*
221221
path: target/distrib/
@@ -233,7 +233,7 @@ jobs:
233233
234234
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
235235
- name: "Upload artifacts"
236-
uses: actions/upload-artifact@v6
236+
uses: actions/upload-artifact@v7
237237
with:
238238
name: artifacts-build-global
239239
path: |
@@ -258,14 +258,14 @@ jobs:
258258
persist-credentials: false
259259
submodules: recursive
260260
- name: Install cached dist
261-
uses: actions/download-artifact@v7
261+
uses: actions/download-artifact@v8
262262
with:
263263
name: cargo-dist-cache
264264
path: ~/.cargo/bin/
265265
- run: chmod +x ~/.cargo/bin/dist
266266
# Fetch artifacts from scratch-storage
267267
- name: Fetch artifacts
268-
uses: actions/download-artifact@v7
268+
uses: actions/download-artifact@v8
269269
with:
270270
pattern: artifacts-*
271271
path: target/distrib/
@@ -278,14 +278,14 @@ jobs:
278278
cat dist-manifest.json
279279
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
280280
- name: "Upload dist-manifest.json"
281-
uses: actions/upload-artifact@v6
281+
uses: actions/upload-artifact@v7
282282
with:
283283
# Overwrite the previous copy
284284
name: artifacts-dist-manifest
285285
path: dist-manifest.json
286286
# Create a GitHub Release while uploading all files to it
287287
- name: "Download GitHub Artifacts"
288-
uses: actions/download-artifact@v7
288+
uses: actions/download-artifact@v8
289289
with:
290290
pattern: artifacts-*
291291
path: artifacts

‎Cargo.toml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ tracing = "0.1.44"
3030
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
3131
warp = { version = "0.4.3", features = ["server"] }
3232
webpki-roots = "1.0.9"
33-
34-
[target.'cfg(not(target_env = "musl"))'.dependencies]
35-
duckdb = { version = "1.10505.0", features = ["bundled"] }
33+
duckdb = { version = "1.10505.0", features = ["bundled", "parquet"] }
3634

3735
[profile.release]
3836
strip = true

‎dist-workspace.toml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = ["cargo:."]
44
# Config for 'dist'
55
[dist]
66
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
7-
cargo-dist-version = "0.30.4"
7+
cargo-dist-version = "0.32.0"
88
# CI backends to support
99
ci = "github"
1010
# The installers to generate for each app
@@ -15,5 +15,10 @@ targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-da
1515
install-updater = true
1616
# Path that installers should place binaries in
1717
install-path = "CARGO_HOME"
18+
# Build (but don't publish) on pull requests
19+
pr-run-mode = "upload"
1820
# Skip checking whether the specified configuration files are up to date
1921
allow-dirty = ["ci"]
22+
23+
[dist.github-custom-runners]
24+
x86_64-unknown-linux-musl = "ubuntu-24.04-arm"

‎docs/app/docs/databases/csv/page.mdx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ twitter:
1717

1818
Open a local CSV file. SQL Studio uses DuckDB under the hood to query CSV files, giving you full SQL access to tabular data.
1919

20-
> **Note:** CSV support is not available in the musl (static Linux) build because it depends on DuckDB. Use the glibc Linux build, macOS, or Windows instead.
21-
2220
## Usage
2321

2422
```bash

‎docs/app/docs/databases/duckdb/page.mdx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ twitter:
1717

1818
Open a local DuckDB database file. DuckDB is an in-process analytical database, ideal for working with large datasets.
1919

20-
> **Note:** DuckDB support is not available in the musl (static Linux) build due to compatibility limitations. Use the glibc Linux build, macOS, or Windows instead.
21-
2220
## Usage
2321

2422
```bash

‎docs/app/docs/databases/parquet/page.mdx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ twitter:
1717

1818
Open a local Apache Parquet file. SQL Studio uses DuckDB under the hood to query Parquet files, giving you full SQL access to columnar data.
1919

20-
> **Note:** Parquet support is not available in the musl (static Linux) build because it depends on DuckDB. Use the glibc Linux build, macOS, or Windows instead.
21-
2220
## Usage
2321

2422
```bash

‎src/main.rs‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,20 @@ enum Command {
7474
},
7575

7676
/// A local DuckDB database.
77-
#[cfg(not(target_env = "musl"))]
7877
Duckdb {
7978
/// Path to the the duckdb file.
8079
#[arg(env)]
8180
database: String,
8281
},
8382

8483
/// A local Parquet file.
85-
#[cfg(not(target_env = "musl"))]
8684
Parquet {
8785
/// Path to the parquet file.
8886
#[arg(env)]
8987
file: String,
9088
},
9189

9290
/// A local CSV file.
93-
#[cfg(not(target_env = "musl"))]
9491
Csv {
9592
/// Path to the CSV file.
9693
#[arg(env)]
@@ -148,15 +145,12 @@ async fn main() -> color_eyre::Result<()> {
148145
AllDbs::Postgres(postgres::Db::open(url, schema, args.timeout.into()).await?)
149146
}
150147
Command::Mysql { url } => AllDbs::Mysql(mysql::Db::open(url, args.timeout.into()).await?),
151-
#[cfg(not(target_env = "musl"))]
152148
Command::Duckdb { database } => {
153149
AllDbs::Duckdb(duckdb::Db::open(database, args.timeout.into()).await?)
154150
}
155-
#[cfg(not(target_env = "musl"))]
156151
Command::Parquet { file } => {
157152
AllDbs::Parquet(parquet::Db::open(file, args.timeout.into()).await?)
158153
}
159-
#[cfg(not(target_env = "musl"))]
160154
Command::Csv { file } => AllDbs::Csv(csv::Db::open(file, args.timeout.into()).await?),
161155
Command::Clickhouse {
162156
url,
@@ -356,11 +350,8 @@ enum AllDbs {
356350
Libsql(libsql::Db),
357351
Postgres(postgres::Db),
358352
Mysql(mysql::Db),
359-
#[cfg(not(target_env = "musl"))]
360353
Duckdb(duckdb::Db),
361-
#[cfg(not(target_env = "musl"))]
362354
Parquet(parquet::Db),
363-
#[cfg(not(target_env = "musl"))]
364355
Csv(csv::Db),
365356
Clickhouse(Box<clickhouse::Db>),
366357
MsSql(mssql::Db),
@@ -373,11 +364,8 @@ impl Database for AllDbs {
373364
AllDbs::Libsql(x) => x.overview().await,
374365
AllDbs::Postgres(x) => x.overview().await,
375366
AllDbs::Mysql(x) => x.overview().await,
376-
#[cfg(not(target_env = "musl"))]
377367
AllDbs::Duckdb(x) => x.overview().await,
378-
#[cfg(not(target_env = "musl"))]
379368
AllDbs::Parquet(x) => x.overview().await,
380-
#[cfg(not(target_env = "musl"))]
381369
AllDbs::Csv(x) => x.overview().await,
382370
AllDbs::Clickhouse(x) => x.overview().await,
383371
AllDbs::MsSql(x) => x.overview().await,
@@ -390,11 +378,8 @@ impl Database for AllDbs {
390378
AllDbs::Libsql(x) => x.tables().await,
391379
AllDbs::Postgres(x) => x.tables().await,
392380
AllDbs::Mysql(x) => x.tables().await,
393-
#[cfg(not(target_env = "musl"))]
394381
AllDbs::Duckdb(x) => x.tables().await,
395-
#[cfg(not(target_env = "musl"))]
396382
AllDbs::Parquet(x) => x.tables().await,
397-
#[cfg(not(target_env = "musl"))]
398383
AllDbs::Csv(x) => x.tables().await,
399384
AllDbs::Clickhouse(x) => x.tables().await,
400385
AllDbs::MsSql(x) => x.tables().await,
@@ -407,11 +392,8 @@ impl Database for AllDbs {
407392
AllDbs::Libsql(x) => x.table(name).await,
408393
AllDbs::Postgres(x) => x.table(name).await,
409394
AllDbs::Mysql(x) => x.table(name).await,
410-
#[cfg(not(target_env = "musl"))]
411395
AllDbs::Duckdb(x) => x.table(name).await,
412-
#[cfg(not(target_env = "musl"))]
413396
AllDbs::Parquet(x) => x.table(name).await,
414-
#[cfg(not(target_env = "musl"))]
415397
AllDbs::Csv(x) => x.table(name).await,
416398
AllDbs::Clickhouse(x) => x.table(name).await,
417399
AllDbs::MsSql(x) => x.table(name).await,
@@ -428,11 +410,8 @@ impl Database for AllDbs {
428410
AllDbs::Libsql(x) => x.table_data(name, page).await,
429411
AllDbs::Postgres(x) => x.table_data(name, page).await,
430412
AllDbs::Mysql(x) => x.table_data(name, page).await,
431-
#[cfg(not(target_env = "musl"))]
432413
AllDbs::Duckdb(x) => x.table_data(name, page).await,
433-
#[cfg(not(target_env = "musl"))]
434414
AllDbs::Parquet(x) => x.table_data(name, page).await,
435-
#[cfg(not(target_env = "musl"))]
436415
AllDbs::Csv(x) => x.table_data(name, page).await,
437416
AllDbs::Clickhouse(x) => x.table_data(name, page).await,
438417
AllDbs::MsSql(x) => x.table_data(name, page).await,
@@ -445,11 +424,8 @@ impl Database for AllDbs {
445424
AllDbs::Libsql(x) => x.tables_with_columns().await,
446425
AllDbs::Postgres(x) => x.tables_with_columns().await,
447426
AllDbs::Mysql(x) => x.tables_with_columns().await,
448-
#[cfg(not(target_env = "musl"))]
449427
AllDbs::Duckdb(x) => x.tables_with_columns().await,
450-
#[cfg(not(target_env = "musl"))]
451428
AllDbs::Parquet(x) => x.tables_with_columns().await,
452-
#[cfg(not(target_env = "musl"))]
453429
AllDbs::Csv(x) => x.tables_with_columns().await,
454430
AllDbs::Clickhouse(x) => x.tables_with_columns().await,
455431
AllDbs::MsSql(x) => x.tables_with_columns().await,
@@ -462,11 +438,8 @@ impl Database for AllDbs {
462438
AllDbs::Libsql(x) => x.query(query).await,
463439
AllDbs::Postgres(x) => x.query(query).await,
464440
AllDbs::Mysql(x) => x.query(query).await,
465-
#[cfg(not(target_env = "musl"))]
466441
AllDbs::Duckdb(x) => x.query(query).await,
467-
#[cfg(not(target_env = "musl"))]
468442
AllDbs::Parquet(x) => x.query(query).await,
469-
#[cfg(not(target_env = "musl"))]
470443
AllDbs::Csv(x) => x.query(query).await,
471444
AllDbs::Clickhouse(x) => x.query(query).await,
472445
AllDbs::MsSql(x) => x.query(query).await,
@@ -479,11 +452,8 @@ impl Database for AllDbs {
479452
AllDbs::Libsql(x) => x.erd().await,
480453
AllDbs::Postgres(x) => x.erd().await,
481454
AllDbs::Mysql(x) => x.erd().await,
482-
#[cfg(not(target_env = "musl"))]
483455
AllDbs::Duckdb(x) => x.erd().await,
484-
#[cfg(not(target_env = "musl"))]
485456
AllDbs::Parquet(x) => x.erd().await,
486-
#[cfg(not(target_env = "musl"))]
487457
AllDbs::Csv(x) => x.erd().await,
488458
AllDbs::Clickhouse(x) => x.erd().await,
489459
AllDbs::MsSql(x) => x.erd().await,
@@ -2770,7 +2740,6 @@ mod mysql {
27702740
}
27712741
}
27722742

2773-
#[cfg(not(target_env = "musl"))]
27742743
mod duckdb {
27752744
use color_eyre::eyre;
27762745
use color_eyre::eyre::OptionExt;
@@ -3255,7 +3224,6 @@ mod duckdb {
32553224
}
32563225
}
32573226

3258-
#[cfg(not(target_env = "musl"))]
32593227
mod parquet {
32603228
use color_eyre::eyre;
32613229
use color_eyre::eyre::OptionExt;
@@ -3583,7 +3551,6 @@ mod parquet {
35833551
}
35843552
}
35853553

3586-
#[cfg(not(target_env = "musl"))]
35873554
mod csv {
35883555
use color_eyre::eyre;
35893556
use color_eyre::eyre::OptionExt;
@@ -5066,7 +5033,6 @@ mod mssql {
50665033
}
50675034

50685035
mod helpers {
5069-
#[cfg(not(target_env = "musl"))]
50705036
use duckdb::types::ValueRef as DuckdbValue;
50715037
use libsql::Value as LibsqlValue;
50725038
use tiberius::ColumnData;
@@ -5106,7 +5072,6 @@ mod helpers {
51065072
}
51075073
}
51085074

5109-
#[cfg(not(target_env = "musl"))]
51105075
pub fn duckdb_value_to_json(v: DuckdbValue) -> serde_json::Value {
51115076
use DuckdbValue::*;
51125077
match v {

0 commit comments

Comments
 (0)