pub struct D1DatabaseSession(/* private fields */);Expand description
A D1 session that provides sequential consistency between queries.
Implementations§
Source§impl D1DatabaseSession
impl D1DatabaseSession
Sourcepub fn prepare<T: Into<String>>(&self, query: T) -> D1PreparedStatement
pub fn prepare<T: Into<String>>(&self, query: T) -> D1PreparedStatement
Prepare a query statement from a query string.
Sourcepub async fn batch(
&self,
statements: Vec<D1PreparedStatement>,
) -> Result<Vec<D1Result>>
pub async fn batch( &self, statements: Vec<D1PreparedStatement>, ) -> Result<Vec<D1Result>>
Batch execute one or more statements against the database using this session.
Returns the results in the same order as the provided statements.
Sourcepub fn get_bookmark(&self) -> Result<Option<D1SessionBookmark>>
pub fn get_bookmark(&self) -> Result<Option<D1SessionBookmark>>
Returns the latest bookmark seen by this session.
If no query has been executed in this session yet, returns None.
Trait Implementations§
Source§impl AsRef<JsValue> for D1DatabaseSession
impl AsRef<JsValue> for D1DatabaseSession
Source§impl Debug for D1DatabaseSession
impl Debug for D1DatabaseSession
Source§impl From<D1DatabaseSession> for JsValue
impl From<D1DatabaseSession> for JsValue
Source§fn from(session: D1DatabaseSession) -> Self
fn from(session: D1DatabaseSession) -> Self
Converts to this type from the input type.
Source§impl From<D1DatabaseSession> for D1DatabaseSession
impl From<D1DatabaseSession> for D1DatabaseSession
Source§fn from(inner: D1DatabaseSessionSys) -> Self
fn from(inner: D1DatabaseSessionSys) -> Self
Converts to this type from the input type.
Source§impl JsCast for D1DatabaseSession
impl JsCast for D1DatabaseSession
Source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
Performs a dynamic
instanceof check to see whether the JsValue
provided is an instance of this type. Read moreSource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
Source§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
Test whether this JS value has a type
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the
target type
T. Read moreSource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the
target type
T. Read moreSource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
Source§fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Performs a zero-cost unchecked cast into a reference to the specified
type. Read more
impl Send for D1DatabaseSession
impl Sync for D1DatabaseSession
Auto Trait Implementations§
impl Freeze for D1DatabaseSession
impl RefUnwindSafe for D1DatabaseSession
impl Unpin for D1DatabaseSession
impl UnsafeUnpin for D1DatabaseSession
impl UnwindSafe for D1DatabaseSession
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
Source§impl<T> TryFromJsValue for Twhere
T: JsCast,
impl<T> TryFromJsValue for Twhere
T: JsCast,
Source§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
Source§impl<T> VectorRefIntoWasmAbi for T
impl<T> VectorRefIntoWasmAbi for T
Source§fn slice_into_abi(slice: &[T]) -> WasmSlice
fn slice_into_abi(slice: &[T]) -> WasmSlice
Construct the wire representation for
Some(slice). The returned
WasmSlice is either a borrow of the input slice (primitive
case) or a buffer JS owns and frees (handle-shaped case).Source§fn slice_none() -> WasmSlicewhere
Self: Sized,
fn slice_none() -> WasmSlicewhere
Self: Sized,
Wire representation for
None (used by Option<&[T]>). A null
WasmSlice (ptr == 0) is the convention shared with every
other vector-like ABI in the crate.