Skip to content

Cannot create BOOLEAN and UNSIGNED BIG INT #1377

Description

@pavel-cpp

It is critically important for me that some of the fields in the database are of these types.

create table Statistics
(
ID INTEGER not null
primary key autoincrement
unique,
PacketsCount UNSIGNED BIG INT,
FilesCount UNSIGNED BIG INT,
ErrorsCount UNSIGNED BIG INT,
DBConnected BOOLEAN default 0 not null
);

For this script, I use the following model:

struct statistics {
    int id;
    std::optional<uint64_t> packets_count;
    std::optional<uint64_t> files_count;
    std::optional<uint64_t> errors_count;
    bool db_connected;
};

make_table("Statistics",
    make_column("ID", &statistics::id, primary_key().autoincrement()),
    make_column("PacketsCount", &statistics::packets_count),
    make_column("FilesCount", &statistics::files_count),
    make_column("ErrorsCount", &statistics::errors_count),
    make_column("DBConnected", &statistics::db_connected, default_value(false))
),

But as a result, when calling sync_schema I get the following table

create table Statistics
(
ID INTEGER not null
primary key autoincrement,
PacketsCount INTEGER,
FilesCount INTEGER,
ErrorsCount INTEGER,
DBConnected INTEGER default 0 not null
);

How can I solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions