pub struct ConnectionPool { /* private fields */ }Expand description
A raw connection pool, giving out both synchronous and asynchronous leases to SQLite connections as well as managing update hooks.
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, PowerSyncError>
Sourcepub fn wrap_connections(
writer: Connection,
readers: impl IntoIterator<Item = Connection>,
) -> Self
pub fn wrap_connections( writer: Connection, readers: impl IntoIterator<Item = Connection>, ) -> Self
Creates a pool backed by a single write ad multiple reader connections.
Connections will be configured to use WAL mode.
Sourcepub fn single_connection(conn: Connection) -> Self
pub fn single_connection(conn: Connection) -> Self
Creates a connection pool backed by a single sqlite connection.
pub fn update_notifiers(&self) -> &Arc<TableNotifiers>
pub async fn writer(&self) -> impl LeasedConnection
pub fn writer_sync(&self) -> impl LeasedConnection
pub async fn reader(&self) -> impl LeasedConnection
pub fn reader_sync(&self) -> impl LeasedConnection
Trait Implementations§
Source§impl Clone for ConnectionPool
impl Clone for ConnectionPool
Source§fn clone(&self) -> ConnectionPool
fn clone(&self) -> ConnectionPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionPool
impl !RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl !UnwindSafe for ConnectionPool
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