Skip to content

Commit

Permalink
sqlx lifetimes issue
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdebernardini committed Aug 16, 2024
1 parent 295b979 commit 857c03c
Show file tree
Hide file tree
Showing 11 changed files with 695 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"example-crates/wallet_electrum",
"example-crates/wallet_esplora_blocking",
"example-crates/wallet_esplora_async",
"example-crates/wallet_esplora_async_sqlx",
"example-crates/wallet_rpc",
]

Expand Down
2 changes: 2 additions & 0 deletions crates/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ miniscript = { version = "12.0.0", optional = true, default-features = false }
# Feature dependencies
rusqlite = { version = "0.31.0", features = ["bundled"], optional = true }
serde_json = {version = "1", optional = true }
sqlx = { version = "0.8.0", default-features = false, features = ["runtime-tokio-rustls", "postgres", "json", "chrono", "uuid", "sqlx-macros", "migrate"], optional= true }

[dev-dependencies]
rand = "0.8"
Expand All @@ -33,3 +34,4 @@ default = ["std", "miniscript"]
std = ["bitcoin/std", "miniscript?/std"]
serde = ["dep:serde", "bitcoin/serde", "miniscript?/serde"]
rusqlite = ["std", "dep:rusqlite", "serde", "serde_json"]
sqlx = ["std", "dep:sqlx", "serde", "serde_json"]
4 changes: 4 additions & 0 deletions crates/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ pub use indexer::keychain_txout;
pub use spk_iter::*;
#[cfg(feature = "rusqlite")]
pub mod rusqlite_impl;
#[cfg(feature = "sqlx")]
pub mod sqlx_impl;
pub mod spk_client;

#[allow(unused_imports)]
#[macro_use]
extern crate alloc;
#[cfg(feature = "rusqlite")]
pub extern crate rusqlite;
#[cfg(feature = "sqlx")]
pub extern crate sqlx;
#[cfg(feature = "serde")]
pub extern crate serde;

Expand Down
2 changes: 1 addition & 1 deletion crates/chain/src/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub trait PersistWith<Db>: Staged + Sized {
) -> Result<(), Self::PersistError>;
}

type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>;
pub type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>;

Check failure on line 48 in crates/chain/src/persist.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

error: missing documentation for a type alias --> crates/chain/src/persist.rs:48:1 | 48 | pub type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D missing-docs` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(missing_docs)]`

/// Trait that persists the type with an async `Db`.
pub trait PersistAsyncWith<Db>: Staged + Sized {
Expand Down
Loading

0 comments on commit 857c03c

Please sign in to comment.