Struct datamodel_renderer::configuration::Generator
source · pub struct Generator<'a> { /* private fields */ }
Expand description
The generator block of the datasource.
Implementations§
source§impl<'a> Generator<'a>
impl<'a> Generator<'a>
sourcepub fn new(name: &'a str, provider: impl Into<Env<'a>>) -> Self
pub fn new(name: &'a str, provider: impl Into<Env<'a>>) -> Self
A new generator with the required values set.
ⓘ
generator js {
// ^^ name
provider = "prisma-client-js"
// ^^^^^^^^^^^^^^^^ provider
}
sourcepub fn output(&mut self, output: impl Into<Env<'a>>)
pub fn output(&mut self, output: impl Into<Env<'a>>)
Sets an output target.
ⓘ
generator js {
output = env("OUTPUT_DIR")
// ^^^^^^^^^^ this
}
sourcepub fn push_preview_feature(&mut self, feature: PreviewFeature)
pub fn push_preview_feature(&mut self, feature: PreviewFeature)
Add a new preview feature to the generator block.
ⓘ
generator js {
previewFeatures = ["postgresqlExtensions"]
// ^^^^^^^^^^^^^^^^^^^^ pushed here
}
sourcepub fn push_binary_target(&mut self, target: impl Into<Env<'a>>)
pub fn push_binary_target(&mut self, target: impl Into<Env<'a>>)
Add a new binary target to the generator block.
ⓘ
generator js {
binaryTargets = [env("FOO_TARGET")]
// ^^^^^^^^^^^^^^^^^ pushed here
}
sourcepub fn documentation(&mut self, docs: impl Into<Cow<'a, str>>)
pub fn documentation(&mut self, docs: impl Into<Cow<'a, str>>)
Set the generator block documentation.
ⓘ
/// This here is the documentation.
generator js {
provider = "prisma-client-js"
}
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Generator<'a>
impl<'a> Send for Generator<'a>
impl<'a> Sync for Generator<'a>
impl<'a> Unpin for Generator<'a>
impl<'a> UnwindSafe for Generator<'a>
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