duckpack 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {duckpack-0.2.1 → duckpack-0.2.2}/Cargo.lock +1 -1
- {duckpack-0.2.1 → duckpack-0.2.2}/Cargo.toml +1 -1
- {duckpack-0.2.1 → duckpack-0.2.2}/PKG-INFO +1 -1
- {duckpack-0.2.1 → duckpack-0.2.2}/pyproject.toml +1 -1
- {duckpack-0.2.1 → duckpack-0.2.2}/src/engine.rs +45 -18
- {duckpack-0.2.1 → duckpack-0.2.2}/tests/test_python_api.py +1 -1
- {duckpack-0.2.1 → duckpack-0.2.2}/.cargo/config.toml +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/.github/workflows/release.yml +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/.gitignore +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/LICENSE +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/README.md +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/duckpack_logo.png +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/__init__.py +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/__main__.py +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/_duckpack.pyi +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/cli.py +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/notebook.py +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/py.typed +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/runner.py +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/python/duckpack/terminal.py +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/scripts/scaffold_demo_project.sh +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/catalog.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/diff.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/ide/editor.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/ide/explorer.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/ide/mod.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/ide/modals.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/lib.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/main.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/python.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/query.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/syntax.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/src/tui.rs +0 -0
- {duckpack-0.2.1 → duckpack-0.2.2}/tests/v2_compat_test.rs +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "duckpack"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Declarative schema management, interactive terminal IDE, and in-memory inspection for DuckDB"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Benjamen Terry", email = "benjamenjterry@gmail.com" }]
|
|
@@ -300,7 +300,7 @@ pub fn ensure_extension_loaded(conn: &Connection, ext_name: &str) -> Result<()>
|
|
|
300
300
|
let info_filename = format!("{}.duckdb_extension.info", ext_name);
|
|
301
301
|
|
|
302
302
|
let mut candidate_folders = Vec::new();
|
|
303
|
-
if !hash_str.is_empty() {
|
|
303
|
+
if !hash_str.is_empty() && hash_str != "v2.0.0" {
|
|
304
304
|
candidate_folders.push(base_ext_dir.join(hash_str).join(platform));
|
|
305
305
|
}
|
|
306
306
|
candidate_folders.push(base_ext_dir.join(&release_tag).join(platform));
|
|
@@ -311,8 +311,17 @@ pub fn ensure_extension_loaded(conn: &Connection, ext_name: &str) -> Result<()>
|
|
|
311
311
|
for folder in &candidate_folders {
|
|
312
312
|
let candidate_file = folder.join(&target_filename);
|
|
313
313
|
if candidate_file.exists() {
|
|
314
|
-
// If
|
|
315
|
-
if
|
|
314
|
+
// If a corrupted or 0-byte file exists from an interrupted download, purge it
|
|
315
|
+
if let Ok(meta) = candidate_file.metadata() {
|
|
316
|
+
if meta.len() < 512 {
|
|
317
|
+
let _ = fs::remove_file(&candidate_file);
|
|
318
|
+
let _ = fs::remove_file(folder.join(&info_filename));
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// If present in v2.0.0 or release folder, sync it to the dev hash directory if distinct
|
|
324
|
+
if !hash_str.is_empty() && hash_str != "v2.0.0" {
|
|
316
325
|
let dest_dir = base_ext_dir.join(hash_str).join(platform);
|
|
317
326
|
if folder != &dest_dir {
|
|
318
327
|
let _ = fs::create_dir_all(&dest_dir);
|
|
@@ -362,32 +371,45 @@ pub fn ensure_extension_loaded(conn: &Connection, ext_name: &str) -> Result<()>
|
|
|
362
371
|
let install_res = conn
|
|
363
372
|
.execute(&format!("FORCE INSTALL '{}';", cdn_url), [])
|
|
364
373
|
.or_else(|_| conn.execute(&format!("INSTALL '{}';", cdn_url), []));
|
|
374
|
+
|
|
365
375
|
if install_res.is_ok() {
|
|
366
|
-
//
|
|
376
|
+
// Verify if the extension file on disk was installed and is not 0 bytes
|
|
377
|
+
let mut valid_file_found = false;
|
|
367
378
|
if let Ok(home) = std::env::var("HOME") {
|
|
368
379
|
let base_ext_dir = PathBuf::from(&home).join(".duckdb").join("extensions");
|
|
369
380
|
let target_filename = format!("{}.duckdb_extension", ext_name);
|
|
370
381
|
let info_filename = format!("{}.duckdb_extension.info", ext_name);
|
|
371
382
|
|
|
372
|
-
|
|
373
|
-
let
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
let
|
|
383
|
+
for ver in &versions {
|
|
384
|
+
let ext_file = base_ext_dir.join(ver).join(platform).join(&target_filename);
|
|
385
|
+
if ext_file.exists() {
|
|
386
|
+
if ext_file.metadata().map(|m| m.len()).unwrap_or(0) >= 512 {
|
|
387
|
+
valid_file_found = true;
|
|
388
|
+
|
|
389
|
+
// Only replicate if destination directory is distinct from source
|
|
390
|
+
if !hash_str.is_empty() && hash_str != "v2.0.0" && hash_str != ver.as_str() {
|
|
391
|
+
let dest_dir = base_ext_dir.join(hash_str).join(platform);
|
|
392
|
+
let _ = fs::create_dir_all(&dest_dir);
|
|
393
|
+
let _ = fs::copy(&ext_file, dest_dir.join(&target_filename));
|
|
394
|
+
let src_info = base_ext_dir.join(ver).join(platform).join(&info_filename);
|
|
395
|
+
if src_info.exists() {
|
|
396
|
+
let _ = fs::copy(&src_info, dest_dir.join(&info_filename));
|
|
397
|
+
}
|
|
384
398
|
}
|
|
385
399
|
break;
|
|
400
|
+
} else {
|
|
401
|
+
// File is corrupted or 0-byte (e.g. 404 response): delete it immediately
|
|
402
|
+
let _ = fs::remove_file(&ext_file);
|
|
403
|
+
let _ = fs::remove_file(base_ext_dir.join(ver).join(platform).join(&info_filename));
|
|
386
404
|
}
|
|
387
405
|
}
|
|
388
406
|
}
|
|
389
407
|
}
|
|
390
408
|
|
|
409
|
+
if !valid_file_found {
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
|
|
391
413
|
// Load via standard name, then fallback to direct path
|
|
392
414
|
let load_res = conn
|
|
393
415
|
.execute(&format!("LOAD {};", ext_name), [])
|
|
@@ -397,13 +419,13 @@ pub fn ensure_extension_loaded(conn: &Connection, ext_name: &str) -> Result<()>
|
|
|
397
419
|
let target_filename = format!("{}.duckdb_extension", ext_name);
|
|
398
420
|
|
|
399
421
|
let mut paths = Vec::new();
|
|
400
|
-
if !hash_str.is_empty() {
|
|
422
|
+
if !hash_str.is_empty() && hash_str != "v2.0.0" {
|
|
401
423
|
paths.push(base_ext_dir.join(hash_str).join(platform).join(&target_filename));
|
|
402
424
|
}
|
|
403
425
|
paths.push(base_ext_dir.join("v2.0.0").join(platform).join(&target_filename));
|
|
404
426
|
|
|
405
427
|
for p in &paths {
|
|
406
|
-
if p.exists() {
|
|
428
|
+
if p.exists() && p.metadata().map(|m| m.len()).unwrap_or(0) >= 512 {
|
|
407
429
|
let sql = format!("LOAD '{}';", p.to_string_lossy().replace('\'', "''"));
|
|
408
430
|
if conn.execute(&sql, []).is_ok() {
|
|
409
431
|
return Ok(0);
|
|
@@ -1671,6 +1693,11 @@ mod tests {
|
|
|
1671
1693
|
|
|
1672
1694
|
#[test]
|
|
1673
1695
|
fn test_load_quack_extension() {
|
|
1696
|
+
let test_home = std::env::current_dir().unwrap().join("target").join("test_home");
|
|
1697
|
+
let _ = std::fs::remove_dir_all(&test_home);
|
|
1698
|
+
std::fs::create_dir_all(&test_home).unwrap();
|
|
1699
|
+
unsafe { std::env::set_var("HOME", &test_home); }
|
|
1700
|
+
|
|
1674
1701
|
let conn = open_duckdb_connection().unwrap();
|
|
1675
1702
|
let res = load_quack_extension(&conn);
|
|
1676
1703
|
if res.is_ok() {
|
|
@@ -4,7 +4,7 @@ import pytest
|
|
|
4
4
|
import duckpack
|
|
5
5
|
|
|
6
6
|
def test_duckpack_version_and_exports():
|
|
7
|
-
assert duckpack.__version__ == "0.2.
|
|
7
|
+
assert duckpack.__version__ == "0.2.2"
|
|
8
8
|
assert hasattr(duckpack, "explore")
|
|
9
9
|
assert hasattr(duckpack, "apply")
|
|
10
10
|
assert hasattr(duckpack, "diff")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|