Skip to content

Use Boolean as part of an composite key #35

@vmatt

Description

@vmatt

What are the drawbacks of using Boolean column as part of a composite primary key?

I saw that Boolean data type is not an instance of IKey, thus can't be used as primary/composite key. A simple change (see below) would fix it, but I'm wondering that this might be on purpose.

Describe the solution you'd like

class Boolean(IKey, ColType):
    precision = 0
    python_type = bool

Alternatively boolean col can be to convert boolean to varchar, or int 0/1, but that feels like unnecessary here.
Update: typo fix

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