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

Method write_prelude

sea-orm-codegen/src/entity/writer.rs:341–363  ·  view source on GitHub ↗
(&self, with_prelude: WithPrelude, frontend_format: bool)

Source from the content-addressed store, hash-verified

339 }
340
341 pub fn write_prelude(&self, with_prelude: WithPrelude, frontend_format: bool) -> OutputFile {
342 let mut lines = Vec::new();
343 Self::write_doc_comment(&mut lines);
344 if with_prelude == WithPrelude::AllAllowUnusedImports {
345 Self::write_allow_unused_imports(&mut lines)
346 }
347 let code_blocks = self
348 .entities
349 .iter()
350 .map({
351 if frontend_format {
352 Self::gen_prelude_use_model
353 } else {
354 Self::gen_prelude_use
355 }
356 })
357 .collect();
358 Self::write(&mut lines, code_blocks);
359 OutputFile {
360 name: "prelude.rs".to_owned(),
361 content: lines.join("\n"),
362 }
363 }
364
365 pub fn write_sea_orm_active_enums(
366 &self,

Callers 1

generateMethod · 0.80

Calls 2

joinMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected