From 85941798e67e9d7dc532a87ee8273062c23959c6 Mon Sep 17 00:00:00 2001 From: Nathan Faucett Date: Mon, 6 Jul 2026 12:15:59 -0400 Subject: [PATCH] Expose FromValue trait without Sealed implementation --- libsql/src/lib.rs | 2 +- libsql/src/rows.rs | 19 +------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/libsql/src/lib.rs b/libsql/src/lib.rs index 13cf082eb7..6f247d33e1 100644 --- a/libsql/src/lib.rs +++ b/libsql/src/lib.rs @@ -183,7 +183,7 @@ pub use self::{ connection::{AuthHook, BatchRows, Connection, Op}, database::{Builder, Database}, load_extension_guard::LoadExtensionGuard, - rows::{Column, Row, Rows}, + rows::{Column, FromValue, Row, Rows}, statement::Statement, transaction::{Transaction, TransactionBehavior}, }; diff --git a/libsql/src/rows.rs b/libsql/src/rows.rs index 39411b8373..9fb5e8ecca 100644 --- a/libsql/src/rows.rs +++ b/libsql/src/rows.rs @@ -153,7 +153,7 @@ impl fmt::Debug for Row { } /// Convert a `Value` into the implementors type. -pub trait FromValue: Sealed { +pub trait FromValue { fn from_sql(val: Value) -> Result where Self: Sized; @@ -164,7 +164,6 @@ impl FromValue for crate::Value { Ok(val) } } -impl Sealed for crate::Value {} impl FromValue for i32 { fn from_sql(val: Value) -> Result { @@ -175,7 +174,6 @@ impl FromValue for i32 { } } } -impl Sealed for i32 {} impl FromValue for u32 { fn from_sql(val: Value) -> Result { @@ -186,7 +184,6 @@ impl FromValue for u32 { } } } -impl Sealed for u32 {} impl FromValue for i64 { fn from_sql(val: Value) -> Result { @@ -197,7 +194,6 @@ impl FromValue for i64 { } } } -impl Sealed for i64 {} impl FromValue for u64 { fn from_sql(val: Value) -> Result { @@ -208,7 +204,6 @@ impl FromValue for u64 { } } } -impl Sealed for u64 {} impl FromValue for f64 { fn from_sql(val: Value) -> Result { @@ -219,7 +214,6 @@ impl FromValue for f64 { } } } -impl Sealed for f64 {} impl FromValue for Vec { fn from_sql(val: Value) -> Result { @@ -230,7 +224,6 @@ impl FromValue for Vec { } } } -impl Sealed for Vec {} impl FromValue for [u8; N] { fn from_sql(val: Value) -> Result { @@ -243,7 +236,6 @@ impl FromValue for [u8; N] { } } } -impl Sealed for [u8; N] {} impl FromValue for String { fn from_sql(val: Value) -> Result { @@ -254,7 +246,6 @@ impl FromValue for String { } } } -impl Sealed for String {} impl FromValue for bool { fn from_sql(val: Value) -> Result { @@ -269,7 +260,6 @@ impl FromValue for bool { } } } -impl Sealed for bool {} impl FromValue for Option where @@ -282,7 +272,6 @@ where } } } -impl Sealed for Option {} pub(crate) trait ColumnsInner { fn column_name(&self, idx: i32) -> Option<&str>; @@ -294,9 +283,3 @@ pub(crate) trait RowInner: ColumnsInner + fmt::Debug { fn column_value(&self, idx: i32) -> Result; fn column_str(&self, idx: i32) -> Result<&str>; } - -mod sealed { - pub trait Sealed {} -} - -use sealed::Sealed;