MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / generate

Method generate

sea-orm-codegen/src/entity/writer.rs:205–223  ·  view source on GitHub ↗
(self, context: &EntityWriterContext)

Source from the content-addressed store, hash-verified

203
204impl EntityWriter {
205 pub fn generate(self, context: &EntityWriterContext) -> WriterOutput {
206 let mut files = Vec::new();
207 files.extend(self.write_entities(context));
208 let with_prelude = context.with_prelude != WithPrelude::None;
209 files.push(self.write_index_file(context.lib, with_prelude, context.seaography));
210 if with_prelude {
211 files.push(self.write_prelude(context.with_prelude, context.frontend_format));
212 }
213 if !self.enums.is_empty() {
214 files.push(self.write_sea_orm_active_enums(
215 &context.with_serde,
216 context.with_copy_enums,
217 &context.enum_extra_derives,
218 &context.enum_extra_attributes,
219 context.frontend_format,
220 ));
221 }
222 WriterOutput { files }
223 }
224
225 pub fn write_entities(&self, context: &EntityWriterContext) -> Vec<OutputFile> {
226 self.entities

Callers 1

run_generate_commandFunction · 0.80

Calls 6

write_entitiesMethod · 0.80
pushMethod · 0.80
write_index_fileMethod · 0.80
write_preludeMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected