pub struct GeneratorContext { /* private fields */ }Implementations§
Source§impl GeneratorContext
impl GeneratorContext
pub fn new(settings: SqlGeneratorSettings, writer: SqlWriter) -> Self
Sourcepub fn for_model(
database_model: Rc<DatabaseModel>,
database_type: DatabaseType,
) -> Self
pub fn for_model( database_model: Rc<DatabaseModel>, database_type: DatabaseType, ) -> Self
Builds a context from just a model and dialect, with an in-memory output sink -
for callers (e.g. schema-migration-generator) that only need to call column-level
generator methods (column type / check constraint rendering), not run a full
CREATE TABLE generation. GenerateOptions::new’s default boolean_mode is
Native, so it’s overridden here from database_model.boolean_mode() - the model
always carries the real configured mode.
pub fn settings(&self) -> &SqlGeneratorSettings
pub fn writer(&self) -> Rc<RefCell<SqlWriter>>
pub fn with_writer<F>(&self, f: F)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GeneratorContext
impl !Send for GeneratorContext
impl !Sync for GeneratorContext
impl !UnwindSafe for GeneratorContext
impl Freeze for GeneratorContext
impl Unpin for GeneratorContext
impl UnsafeUnpin for GeneratorContext
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