Skip to content

db.get_schema_registry("my_crate::entity::*") issue #2899

@tcanabrava

Description

@tcanabrava

The documentation, for the EntityFirst approach, states that the schema_registry should be done with a ::* at the end, but this breaks registration:

// synchronizes database schema with entity definitions
db.get_schema_registry("my_crate::entity::*").sync(db).await?;

But the code that does the registration uses .starts_with:

    for entity in inventory::iter::<EntityRegistry>() {
        if entity.module_path.starts_with(module_path) {

it took me a while to figure out why nothing was working and I had to dig deep in code.
There are two fixes that might be worh.:

1 - fix the documentation (and blogposts) to remote the ::*
2 - add a print to stderr saying that the module path is unexpected, to help the development process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions