mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-02 23:08:58 +08:00
Introduce SqlFnArg
This commit is contained in:
@@ -22,6 +22,11 @@ pub enum ToSqlOutput<'a> {
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "blob")))]
|
||||
ZeroBlob(i32),
|
||||
|
||||
/// n-th arg of an SQL scalar function
|
||||
#[cfg(feature = "functions")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "functions")))]
|
||||
Arg(usize),
|
||||
|
||||
/// `feature = "array"`
|
||||
#[cfg(feature = "array")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "array")))]
|
||||
@@ -107,6 +112,8 @@ impl ToSql for ToSqlOutput<'_> {
|
||||
|
||||
#[cfg(feature = "blob")]
|
||||
ToSqlOutput::ZeroBlob(i) => ToSqlOutput::ZeroBlob(i),
|
||||
#[cfg(feature = "functions")]
|
||||
ToSqlOutput::Arg(i) => ToSqlOutput::Arg(i),
|
||||
#[cfg(feature = "array")]
|
||||
ToSqlOutput::Array(ref a) => ToSqlOutput::Array(a.clone()),
|
||||
})
|
||||
@@ -292,13 +299,6 @@ impl ToSql for Value {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToSql for ValueRef<'a> {
|
||||
#[inline]
|
||||
fn to_sql(&self) -> Result<ToSqlOutput<'_>> {
|
||||
Ok(ToSqlOutput::Borrowed(*self))
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ToSql> ToSql for Option<T> {
|
||||
#[inline]
|
||||
fn to_sql(&self) -> Result<ToSqlOutput<'_>> {
|
||||
|
||||
Reference in New Issue
Block a user