Skip to content

Commit cfda58b

Browse files
authored
upgrade to 0.8.0 (#160)
* upgrade to 0.8.0 * try fix windows * update code * fix test * fix build error * update * fix path
1 parent 6795035 commit cfda58b

File tree

13 files changed

+247
-36
lines changed

13 files changed

+247
-36
lines changed

.github/workflows/rust.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
name: Download duckdb
3939
with:
4040
repository: "duckdb/duckdb"
41-
tag: "v0.7.1"
41+
tag: "v0.8.0"
4242
fileName: ${{ matrix.duckdb }}
4343
out-file-path: .
4444

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "duckdb"
3-
version = "0.7.1"
3+
version = "0.8.0"
44
authors = ["wangfenjin <[email protected]>"]
55
edition = "2021"
66
description = "Ergonomic wrapper for DuckDB"
@@ -81,7 +81,7 @@ tempdir = "0.3.7"
8181

8282
[dependencies.libduckdb-sys]
8383
path = "libduckdb-sys"
84-
version = "0.7.1"
84+
version = "0.8.0"
8585

8686
[package.metadata.docs.rs]
8787
features = []

libduckdb-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libduckdb-sys"
3-
version = "0.7.1"
3+
version = "0.8.0"
44
authors = ["wangfenjin <[email protected]>"]
55
edition = "2021"
66
build = "build.rs"

libduckdb-sys/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ mod build_bundled {
100100
#[cfg(not(feature = "buildtime_bindgen"))]
101101
{
102102
use std::fs;
103-
fs::copy(format!("{}/bindgen_bundled_version.rs", lib_name), out_path)
104-
.expect("Could not copy bindings to output directory");
103+
fs::copy("src/bindgen_bundled_version.rs", out_path).expect("Could not copy bindings to output directory");
105104
}
106105

107106
let manifest_file = std::fs::File::open(format!("{}/manifest.json", lib_name)).expect("manifest file");

libduckdb-sys/duckdb-sources

Submodule duckdb-sources updated 3541 files

libduckdb-sys/duckdb.tar.gz

231 KB
Binary file not shown.

libduckdb-sys/src/bindgen_bundled_version.rs

Lines changed: 211 additions & 5 deletions
Large diffs are not rendered by default.

libduckdb-sys/update_sources.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
DUCKDB_SCRIPTS_DIR = os.path.join(SCRIPT_DIR, "duckdb-sources", "scripts")
1212
# Path to target
1313
TARGET_DIR = os.path.join(SCRIPT_DIR, "duckdb")
14+
# Path to src
15+
SRC_DIR = os.path.join(SCRIPT_DIR, "src")
1416

1517
# List of extensions' sources to grab. Technically, these sources will be compiled
1618
# but not included in the final build unless they're explicitly enabled.
@@ -27,6 +29,7 @@
2729
# Clear the duckdb directory
2830
try:
2931
shutil.rmtree(os.path.join(TARGET_DIR))
32+
os.remove(os.path.join(SCRIPT_DIR, "duckdb.tar.gz"))
3033
except FileNotFoundError:
3134
pass
3235

@@ -73,6 +76,12 @@ def get_sources(extensions):
7376
json.dump(manifest, f, indent=2)
7477

7578

79+
subprocess.check_call(
80+
"tar -czf duckdb.tar.gz duckdb",
81+
shell=True,
82+
cwd=SCRIPT_DIR,
83+
)
84+
7685
subprocess.check_call(
7786
'find "' + SCRIPT_DIR + '/../target" -type f -name bindgen.rs -exec rm {} \;',
7887
shell=True,
@@ -82,18 +91,19 @@ def get_sources(extensions):
8291
'env LIBDUCKDB_SYS_BUNDLING=1 cargo test --features "bundled buildtime_bindgen"',
8392
shell=True,
8493
)
94+
8595
print(
8696
'find "'
8797
+ SCRIPT_DIR
8898
+ '/../target" -type f -name "bindgen.rs" -exec cp {} "'
89-
+ TARGET_DIR
99+
+ SRC_DIR
90100
+ '/bindgen_bundled_version.rs" \;'
91101
)
92102
subprocess.check_call(
93103
'find "'
94104
+ SCRIPT_DIR
95105
+ '/../target" -type f -name "bindgen.rs" -exec cp {} "'
96-
+ TARGET_DIR
106+
+ SRC_DIR
97107
+ '/bindgen_bundled_version.rs" \;',
98108
shell=True,
99109
)
@@ -104,9 +114,3 @@ def get_sources(extensions):
104114
SCRIPT_DIR, "duckdb-sources", "extension", "httpfs", "httpfs_config.py"
105115
)
106116
)
107-
108-
subprocess.check_call(
109-
"tar -czf duckdb.tar.gz duckdb",
110-
shell=True,
111-
cwd=SCRIPT_DIR,
112-
)

libduckdb-sys/upgrade.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export DUCKDB_LIB_DIR="$SCRIPT_DIR/duckdb"
1010
export DU_INCLUDE_DIR="$DUCKDB_LIB_DIR"
1111

1212
# Download and extract amalgamation
13-
DUCKDB_VERSION=v0.7.1
14-
git submodule update --init
13+
DUCKDB_VERSION=v0.8.0
14+
git submodule update --init --checkout
1515
cd "$SCRIPT_DIR/duckdb-sources" || { echo "fatal error" >&2; exit 1; }
1616
git checkout "$DUCKDB_VERSION"
1717
cd "$SCRIPT_DIR" || { echo "fatal error" >&2; exit 1; }
18-
python "$SCRIPT_DIR/update_sources.py"
18+
python3 "$SCRIPT_DIR/update_sources.py"
1919

2020
# Regenerate bindgen file for DUCKDB
2121
rm -f "$SCRIPT_DIR/src/bindgen_bundled_version.rs"

src/cache.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@ mod test {
205205
{
206206
let mut stmt = db.prepare_cached(sql)?;
207207
assert_eq!(0, cache.len());
208-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
208+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
209209
}
210210
assert_eq!(1, cache.len());
211211

212212
{
213213
let mut stmt = db.prepare_cached(sql)?;
214214
assert_eq!(0, cache.len());
215-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
215+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
216216
}
217217
assert_eq!(1, cache.len());
218218

@@ -231,7 +231,7 @@ mod test {
231231
{
232232
let mut stmt = db.prepare_cached(sql)?;
233233
assert_eq!(0, cache.len());
234-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
234+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
235235
}
236236
assert_eq!(1, cache.len());
237237

@@ -241,15 +241,15 @@ mod test {
241241
{
242242
let mut stmt = db.prepare_cached(sql)?;
243243
assert_eq!(0, cache.len());
244-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
244+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
245245
}
246246
assert_eq!(0, cache.len());
247247

248248
db.set_prepared_statement_cache_capacity(8);
249249
{
250250
let mut stmt = db.prepare_cached(sql)?;
251251
assert_eq!(0, cache.len());
252-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
252+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
253253
}
254254
assert_eq!(1, cache.len());
255255
Ok(())
@@ -264,7 +264,7 @@ mod test {
264264
{
265265
let mut stmt = db.prepare_cached(sql)?;
266266
assert_eq!(0, cache.len());
267-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
267+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
268268
stmt.discard();
269269
}
270270
assert_eq!(0, cache.len());
@@ -325,14 +325,14 @@ mod test {
325325
{
326326
let mut stmt = db.prepare_cached(sql)?;
327327
assert_eq!(0, cache.len());
328-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
328+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
329329
}
330330
assert_eq!(1, cache.len());
331331

332332
{
333333
let mut stmt = db.prepare_cached(sql)?;
334334
assert_eq!(0, cache.len());
335-
assert_eq!(4, stmt.query_row([], |r| r.get::<_, i64>(0))?);
335+
assert_eq!("memory", stmt.query_row([], |r| r.get::<_, String>(1))?);
336336
}
337337
assert_eq!(1, cache.len());
338338
Ok(())

0 commit comments

Comments
 (0)