pub struct RenderOptions {
pub dialect: SqlDialect,
pub source_dialect: Option<SqlDialect>,
pub mode: OutputMode,
pub no_copy: bool,
pub batch_size: usize,
pub mssql_production_style: bool,
pub mssql_go: Option<u64>,
}Expand description
Rendering knobs for SqlRenderer, independent of the compiled
crate::generate::GenerationPlan so a caller (the CLI, or a test) can
render the same plan under several target dialects.
Fields§
§dialect: SqlDialectThe dialect to render SQL for.
source_dialect: Option<SqlDialect>The dialect the source schema’s types/DDL were captured in, if known.
None when the model has no source: block (e.g. hand-authored).
mode: OutputModeWhether to render DDL, rows, or both.
no_copy: boolForce multi-row INSERT for PostgreSQL instead of COPY.
batch_size: usizeRows per INSERT/COPY batch.
mssql_production_style: boolRender MSSQL output in “production style”: a SET ANSI_NULLS ON; +
SET QUOTED_IDENTIFIER ON; session header, [dbo].[table]-qualified
identifiers, a named CONSTRAINT [PK_<table>] PRIMARY KEY CLUSTERED
instead of an inline PRIMARY KEY, and an ON [PRIMARY] filegroup
clause on CREATE TABLE. No effect outside SqlDialect::Mssql.
mssql_go: Option<u64>Emit a GO batch separator every N INSERT batches instead of after
every batch (MSSQL only; None keeps today’s per-batch GO). CREATE TABLE and SET IDENTITY_INSERT batches always get their own GO
regardless of this setting — only INSERT batch cadence changes.
Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RenderOptions
Source§impl Debug for RenderOptions
impl Debug for RenderOptions
Auto Trait Implementations§
impl Freeze for RenderOptions
impl RefUnwindSafe for RenderOptions
impl Send for RenderOptions
impl Sync for RenderOptions
impl Unpin for RenderOptions
impl UnsafeUnpin for RenderOptions
impl UnwindSafe for RenderOptions
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more