Skip to content

Commit

Permalink
Merge pull request #3 from duckdb/main
Browse files Browse the repository at this point in the history
DuckDB v0.10.1
  • Loading branch information
mitchdevenport authored Mar 20, 2024
2 parents 375d26e + 62089b6 commit 4e1cf06
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
name: Download duckdb
with:
repository: "duckdb/duckdb"
tag: "v0.10.0"
tag: "v0.10.1"
fileName: ${{ matrix.duckdb }}
out-file-path: .

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "duckdb"
version = "0.10.0"
version = "0.10.1"
authors = ["wangfenjin <[email protected]>"]
edition = "2021"
description = "Ergonomic wrapper for DuckDB"
Expand Down Expand Up @@ -79,7 +79,7 @@ polars-core = "0.35.4"

[dependencies.libduckdb-sys]
path = "libduckdb-sys"
version = "0.10.0"
version = "0.10.1"

[package.metadata.docs.rs]
features = []
Expand Down
1 change: 0 additions & 1 deletion examples/appender.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
extern crate duckdb;
use std::convert::TryFrom;

use duckdb::{params, Connection, DropBehavior, Result};

Expand Down
2 changes: 1 addition & 1 deletion libduckdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libduckdb-sys"
version = "0.10.0"
version = "0.10.1"
authors = ["wangfenjin <[email protected]>"]
edition = "2021"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion libduckdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod openssl;
/// `cfg!(windows)`, since the latter does not properly handle cross-compilation
///
/// Note that there is no way to know at compile-time which system we'll be
/// targetting, and this test must be made at run-time (of the build script) See
/// targeting, and this test must be made at run-time (of the build script) See
/// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
#[allow(dead_code)]
fn win_target() -> bool {
Expand Down
2 changes: 1 addition & 1 deletion libduckdb-sys/duckdb-sources
Submodule duckdb-sources updated 1257 files
Binary file modified libduckdb-sys/duckdb.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion libduckdb-sys/src/bindgen_bundled_version.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libduckdb-sys/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export DUCKDB_LIB_DIR="$SCRIPT_DIR/duckdb"
export DU_INCLUDE_DIR="$DUCKDB_LIB_DIR"

# Download and extract amalgamation
DUCKDB_VERSION=v0.10.0
DUCKDB_VERSION=v0.10.1
git submodule update --init --checkout
cd "$SCRIPT_DIR/duckdb-sources" || { echo "fatal error" >&2; exit 1; }
git fetch
Expand Down
3 changes: 1 addition & 2 deletions src/appender/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{ffi, AppenderParams, Connection, Result, ValueRef};
use std::{ffi::c_void, fmt, iter::IntoIterator, os::raw::c_char};
use std::{ffi::c_void, fmt, os::raw::c_char};

use crate::{
error::result_from_duckdb_appender,
Expand Down Expand Up @@ -170,7 +170,6 @@ impl fmt::Debug for Appender<'_> {
#[cfg(test)]
mod test {
use crate::{Connection, Result};
use std::convert::TryFrom;

#[test]
fn test_append_one_row() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub enum Error {
/// given, the 2nd is how many were expected.
InvalidParameterCount(usize, usize),

/// Apppend Error
/// Append Error
AppendError,
}

Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub use libduckdb_sys as ffi;
use std::{
cell::RefCell,
convert,
default::Default,
ffi::CString,
fmt,
path::{Path, PathBuf},
Expand Down
2 changes: 1 addition & 1 deletion src/r2d2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl r2d2::ManageConnection for DuckdbConnectionManager {
mod test {
extern crate r2d2;
use super::*;
use crate::{types::Value, Result};
use crate::types::Value;
use std::{sync::mpsc, thread};

use tempdir::TempDir;
Expand Down
2 changes: 1 addition & 1 deletion src/raw_statement.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{convert::TryFrom, ffi::CStr, ptr, rc::Rc, sync::Arc};
use std::{ffi::CStr, ptr, rc::Rc, sync::Arc};

use arrow::{
array::StructArray,
Expand Down
2 changes: 1 addition & 1 deletion src/statement.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{convert, ffi::c_void, fmt, iter::IntoIterator, mem, os::raw::c_char, ptr, str};
use std::{convert, ffi::c_void, fmt, mem, os::raw::c_char, ptr, str};

use arrow::{array::StructArray, datatypes::DataType};

Expand Down
15 changes: 9 additions & 6 deletions src/types/chrono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ impl FromSql for NaiveDateTime {
TimeUnit::Microsecond => (t / 1_000_000, (t % 1_000_000) * 1000),
TimeUnit::Nanosecond => (t / 1_000_000_000, t % 1_000_000_000),
};
Ok(NaiveDateTime::from_timestamp_opt(secs, nsecs as u32).unwrap())
}
ValueRef::Date32(d) => Ok(NaiveDateTime::from_timestamp_opt(24 * 3600 * (d as i64), 0).unwrap()),
ValueRef::Time64(TimeUnit::Microsecond, d) => {
Ok(NaiveDateTime::from_timestamp_opt(d / 1_000_000, ((d % 1_000_000) * 1_000) as u32).unwrap())
Ok(DateTime::from_timestamp(secs, nsecs as u32).unwrap().naive_utc())
}
ValueRef::Date32(d) => Ok(DateTime::from_timestamp(24 * 3600 * (d as i64), 0).unwrap().naive_utc()),
ValueRef::Time64(TimeUnit::Microsecond, d) => Ok(DateTime::from_timestamp(
d / 1_000_000,
((d % 1_000_000) * 1_000) as u32,
)
.unwrap()
.naive_utc()),
ValueRef::Text(s) => {
let mut s = std::str::from_utf8(s).unwrap();
let format = match s.len() {
Expand Down Expand Up @@ -206,7 +209,7 @@ mod test {
assert_eq!(utc, v2);

let v3: DateTime<Utc> = db.query_row("SELECT '2016-02-23 23:56:04'", [], |r| r.get(0))?;
assert_eq!(utc - Duration::milliseconds(789), v3);
assert_eq!(utc - Duration::try_milliseconds(789).unwrap(), v3);

let v4: DateTime<Utc> = db.query_row("SELECT '2016-02-23 23:56:04.789+00:00'", [], |r| r.get(0))?;
assert_eq!(utc, v4);
Expand Down
1 change: 0 additions & 1 deletion src/types/from_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ impl FromSql for Value {
mod test {
use super::FromSql;
use crate::{Connection, Error, Result};
use std::convert::TryFrom;

#[test]
fn test_timestamp_raw() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/types/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub enum Value {
Double(f64),
/// The value is a Decimal.
Decimal(Decimal),
/// The value is a timestap.
/// The value is a timestamp.
Timestamp(TimeUnit, i64),
/// The value is a text string.
Text(String),
Expand Down
8 changes: 4 additions & 4 deletions src/types/value_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ pub enum ValueRef<'a> {
HugeInt(i128),
/// The value is a unsigned tiny integer.
UTinyInt(u8),
/// The value is a usigned small integer.
/// The value is a unsigned small integer.
USmallInt(u16),
/// The value is a usigned integer.
/// The value is a unsigned integer.
UInt(u32),
/// The value is a usigned big integer.
/// The value is a unsigned big integer.
UBigInt(u64),
/// The value is a f32.
Float(f32),
/// The value is a f64.
Double(f64),
/// The value is a decimal
Decimal(Decimal),
/// The value is a timestap.
/// The value is a timestamp.
Timestamp(TimeUnit, i64),
/// The value is a text string.
Text(&'a [u8]),
Expand Down
4 changes: 2 additions & 2 deletions src/vtab/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use super::{
use crate::vtab::vector::Inserter;
use arrow::array::{
as_boolean_array, as_large_list_array, as_list_array, as_primitive_array, as_string_array, Array, ArrayData,
ArrowPrimitiveType, BooleanArray, Decimal128Array, FixedSizeListArray, GenericListArray, OffsetSizeTrait,
PrimitiveArray, StringArray, StructArray,
BooleanArray, Decimal128Array, FixedSizeListArray, GenericListArray, OffsetSizeTrait, PrimitiveArray, StringArray,
StructArray,
};

use arrow::{
Expand Down
2 changes: 1 addition & 1 deletion src/vtab/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl VTab for ExcelVTab {
);
}
_ => {
panic!("Shouldn't happend");
panic!("Shouldn't happen");
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/vtab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ impl InnerConnection {
#[cfg(test)]
mod test {
use super::*;
use crate::{Connection, Result};
use std::{
error::Error,
ffi::{c_char, CString},
Expand Down

0 comments on commit 4e1cf06

Please sign in to comment.