Skip to content

Postgres entity generation support base tables. #159

@cooronx

Description

@cooronx

SeaQL/sea-orm#2412

I am researching how to implement this feature. and I found the problem was in sea-schema.

pub fn query_tables(&self, schema: DynIden) -> SelectStatement {
        Query::select()
            .columns(vec![
                TablesFields::TableName,
                TablesFields::UserDefinedTypeSchema,
                TablesFields::UserDefinedTypeName,
            ])
            .from((InformationSchema::Schema, InformationSchema::Tables))
            .and_where(Expr::col(TablesFields::TableSchema).eq(schema.to_string()))
            .and_where(Expr::col(TablesFields::TableType).eq(TableType::BaseTable.to_string()))
            .and_where(
                Expr::col(TablesFields::TableName).not_in_subquery(select_base_table_and_view()), // the child table intentionally removed here
            )
            .take()
}

the child table intentionally removed from this func. Was this designed intentionally? And what's the reason behind it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions