pub struct PrismaService { /* private fields */ }Expand description
Injectable database service: configuration + optional SQLx pool when the sqlx feature is on.
For full Prisma Client Rust codegen, run cargo prisma generate and inject the generated client
as an additional provider; this crate stays ORM-agnostic while giving production-ready connectivity.
Implementations§
Source§impl PrismaService
impl PrismaService
pub fn client(&self) -> &PrismaClientHandle
pub fn options(&self) -> &PrismaOptions
Sourcepub fn health(&self) -> &'static str
pub fn health(&self) -> &'static str
Lightweight status without hitting the network (always "ok" if the service was constructed).
Sourcepub fn query_raw(&self, sql: &str) -> String
pub fn query_raw(&self, sql: &str) -> String
Stub string when sqlx is disabled; enable sqlx for real execution.
pub fn mapping_guidance(&self) -> &'static str
Trait Implementations§
Source§impl DatabasePing for PrismaService
impl DatabasePing for PrismaService
Source§impl Default for PrismaService
impl Default for PrismaService
Source§impl Injectable for PrismaService
impl Injectable for PrismaService
fn construct(_registry: &ProviderRegistry) -> Arc<Self>
Source§fn scope() -> ProviderScope
fn scope() -> ProviderScope
Provider scope used when the module registers this type.
fn on_module_init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_module_destroy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_application_bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for PrismaService
impl RefUnwindSafe for PrismaService
impl Send for PrismaService
impl Sync for PrismaService
impl Unpin for PrismaService
impl UnsafeUnpin for PrismaService
impl UnwindSafe for PrismaService
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