Skip to content

Commit

Permalink
bump sqlx version
Browse files Browse the repository at this point in the history
  • Loading branch information
philsippl authored and TheButlah committed Oct 11, 2024
1 parent c0c436a commit 7728781
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 42 deletions.
90 changes: 55 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rayon = "1.8.1"
reqwest = { version = "0.11.24", features = ["json"] }
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
sqlx = { version = "0.7.3", features = [
sqlx = { version = "0.8", features = [
"runtime-tokio-native-tls",
"any",
"postgres",
Expand Down
12 changes: 6 additions & 6 deletions src/db/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ where
[u8; BYTES_PER_BITS]: sqlx::Decode<'r, DB>,
{
fn decode(
value: <DB as sqlx::database::HasValueRef<'r>>::ValueRef,
value: <DB as sqlx::database::Database>::ValueRef<'r>,
) -> Result<Self, sqlx::error::BoxDynError> {
let bytes = <[u8; BYTES_PER_BITS] as sqlx::Decode<DB>>::decode(value)?;

Expand All @@ -42,8 +42,8 @@ where
{
fn encode_by_ref(
&self,
buf: &mut <DB as sqlx::database::HasArguments<'q>>::ArgumentBuffer,
) -> sqlx::encode::IsNull {
buf: &mut <DB as sqlx::database::Database>::ArgumentBuffer<'q>,
) -> Result<sqlx::encode::IsNull, sqlx::error::BoxDynError> {
let mut bytes: [u8; BYTES_PER_BITS] = [0; BYTES_PER_BITS];

for (i, v) in self.0.into_iter().flat_map(u64::to_be_bytes).enumerate()
Expand Down Expand Up @@ -71,7 +71,7 @@ where
[u8; BYTES_PER_ENCODED_BITS]: sqlx::Decode<'r, DB>,
{
fn decode(
value: <DB as sqlx::database::HasValueRef<'r>>::ValueRef,
value: <DB as sqlx::database::Database>::ValueRef<'r>,
) -> Result<Self, sqlx::error::BoxDynError> {
let bytes =
<[u8; BYTES_PER_ENCODED_BITS] as sqlx::Decode<DB>>::decode(value)?;
Expand All @@ -93,8 +93,8 @@ where
{
fn encode_by_ref(
&self,
buf: &mut <DB as sqlx::database::HasArguments<'q>>::ArgumentBuffer,
) -> sqlx::encode::IsNull {
buf: &mut <DB as sqlx::database::Database>::ArgumentBuffer<'q>,
) -> Result<sqlx::encode::IsNull, sqlx::error::BoxDynError> {
let mut bytes: [u8; BYTES_PER_ENCODED_BITS] =
[0; BYTES_PER_ENCODED_BITS];

Expand Down

0 comments on commit 7728781

Please sign in to comment.