pub struct Number(pub f64);Expand description
Better Auth’s number columns use SQLite INTEGER affinity.
SQLite may return either an integer or a real for the same column, including large JS chain IDs. PostgreSQL returns its INTEGER as i32. Retain the value as a JS Number without requiring a different persisted column type.
Tuple Fields§
§0: f64Trait Implementations§
impl Copy for Number
Source§impl<'r> Decode<'r, Postgres> for Number
Available on crate feature postgres only.
impl<'r> Decode<'r, Postgres> for Number
Available on crate feature
postgres only.Source§fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
Decode a new value of this type using a raw value from the database.
Source§impl<'r> Decode<'r, Sqlite> for Number
Available on crate feature sqlite only.
impl<'r> Decode<'r, Sqlite> for Number
Available on crate feature
sqlite only.Source§fn decode(value: SqliteValueRef<'r>) -> Result<Self, BoxDynError>
fn decode(value: SqliteValueRef<'r>) -> Result<Self, BoxDynError>
Decode a new value of this type using a raw value from the database.
Source§impl Encode<'_, Postgres> for Number
Available on crate feature postgres only.
impl Encode<'_, Postgres> for Number
Available on crate feature
postgres only.Source§fn encode_by_ref(
&self,
buffer: &mut PgArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buffer: &mut PgArgumentBuffer, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Sqlite> for Number
Available on crate feature sqlite only.
impl Encode<'_, Sqlite> for Number
Available on crate feature
sqlite only.Source§fn encode_by_ref(
&self,
buffer: &mut SqliteArgumentsBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buffer: &mut SqliteArgumentsBuffer, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl SqlxValue for Number
impl SqlxValue for Number
Source§const KIND: ColumnKind = ColumnKind::Number
const KIND: ColumnKind = ColumnKind::Number
The column category used to coerce configured raw values.
fn into_sql_value(self) -> SqlValue
Source§fn from_sql_value(value: SqlValue) -> Result<Self, ValueTypeError>
fn from_sql_value(value: SqlValue) -> Result<Self, ValueTypeError>
Errors Read more
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl Freeze for Number
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnsafeUnpin for Number
impl UnwindSafe for Number
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more