Skip to content

Complex column definitions #242

@shawnferry

Description

@shawnferry

I see in #227 adding additional information to the data type.

Is there any way to add the additional column expression e.g. 'columnExpr' as an optionally hidden/truncated field in the ERD view?

For example this expression makes the ERD view difficult

varchar(36) generated always as
        (
        insert(
        insert(
            insert(
            insert(
                hex(
                concat(substr(id_bin,5,4),substr(id_bin,3,2),
                        substr(id_bin,1,2),substr(id_bin,9,8))
                ),
                9,0,'-'),
            14,0,'-'),
        19,0,'-'),
        24,0,'-')
        ) virtual

If I could keep dataType as

varchar(36)

and add columnExpr

generated always as
        (
        insert(
        insert(
            insert(
            insert(
                hex(
                concat(substr(id_bin,5,4),substr(id_bin,3,2),
                        substr(id_bin,1,2),substr(id_bin,9,8))
                ),
                9,0,'-'),
            14,0,'-'),
        19,0,'-'),
        24,0,'-')
        ) virtual

vs as it is today

VARCHAR(36) GENERATED ALWAYS AS ( insert( insert( insert( insert( hex( concat(substr(id_bin,5,4),substr(id_bin,3,2), substr(id_bin,1,2),substr(id_bin,9,8)) ), 9,0,'-'), 14,0,'-'), 19,0,'-'), 24,0,'-') ) virtual

I think it would be easier to work with the complex definitions

For the referenced example I would have columnExpr

CHECK (TEST IN ('A','B','C'))

and for a plain ENUM columnExpr

('A','B','C')

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions