Skip to content

"false" instead of "False" in generated code #65

@Dracax

Description

@Dracax

Describe the bug
In the generated dataclass code a "normal" false appears instead of the python version.

To Reproduce
Steps to reproduce the behavior:

  1. Create a CREATE TABLE statement, containing this column: edited boolean DEFAULT false,
  2. Generate the dataclass: create_models(ddl, models_type="dataclass")
  3. The dataclass has this line: edited: Optional[bool] = false

Expected behavior
false -> False

Screenshots

CREATE TABLE Material
    (
        id integer,
        name      string,
        edited   boolean DEFAULT false,
        deleted  boolean DEFAULT true,
        PRIMARY KEY (id, name)
    );
@dataclass
class Material:

    id: int
    name: str
    edited: bool = false
    deleted: bool = true

If you like a can present a possible fix. In the from_ddl.py and prepare_data function I would change the bool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions