pub struct DefaultIndexGenerator { /* private fields */ }Implementations§
Source§impl DefaultIndexGenerator
impl DefaultIndexGenerator
pub fn new(context: GeneratorContext) -> Self
pub fn context(&self) -> &GeneratorContext
Source§impl DefaultIndexGenerator
impl DefaultIndexGenerator
Sourcepub fn output_indexes_via(&self, generator: &dyn IndexGenerator)
pub fn output_indexes_via(&self, generator: &dyn IndexGenerator)
Same iteration logic as output_indexes, but dispatches each table (and,
transitively, each index) through generator rather than self - see
DefaultFunctionGenerator::output_functions_via for why: a dialect wrapper (e.g.
SqlServerIndexGenerator) that overrides index_options but delegates
output_indexes straight to this struct would otherwise never see its own override
invoked, because Rust has no virtual dispatch on concrete types. Callers that need
their override honored should pass self (as a &dyn IndexGenerator) here instead
of calling output_indexes directly.
Sourcepub fn output_indexes_for_table_via(
&self,
generator: &dyn IndexGenerator,
writer: &mut SqlWriter,
table: &Table,
)
pub fn output_indexes_for_table_via( &self, generator: &dyn IndexGenerator, writer: &mut SqlWriter, table: &Table, )
Same as output_indexes_via, one table at a time - see that method for why
dispatching through generator (rather than calling self.output_index directly)
matters.
Sourcepub fn render_index(
&self,
writer: &mut SqlWriter,
statement_separator: &str,
table: &Table,
key_name: &str,
key: &Key,
index_options: Option<String>,
)
pub fn render_index( &self, writer: &mut SqlWriter, statement_separator: &str, table: &Table, key_name: &str, key: &Key, index_options: Option<String>, )
Renders one create index statement given an already-computed index_options -
shared by DefaultIndexGenerator::output_index and every dialect override, so each
only has to supply its own index_options before calling back into this.