Skip to content

Not using mod.rs as the entry point of the generated entities #2690

@Huliiiiii

Description

@Huliiiiii

Discussed in #2559

Originally posted by nyc4m April 12, 2025
Hey there 👋

When generating entities, I noticed that the output code is using the "old" convention for modules, which is to output the source files as the following:

sea-orm-cli generate entity --database-url <DB_URL> --output-dir ./src/entities

# Resulting module structure
./src/entities
    /entities
        mod.rs
        foo.rs
        bar.rs
        prelude.rs

I'd rather use the "new" convention as described here. This would result in the following file structure:

sea-orm-cli generate entity --database-url <DB_URL> --output-dir ./src/entities

# Resulting module structure
./src/entities/
    entities.rs
    entities/
        foo.rs
        bar.rs
        prelude.rs

Is there anyway I can achieve this with the current CLI ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions