| 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, |