Skip to content

sqlite - Create(...) function is incorrect #841

Open
@johnW-ret

Description

@johnW-ret

Create(...) function is missing NOT NULL columns - which does indeed result in a

Error: SQLite Error 19: 'NOT NULL constraint failed: kanji_service_attributes.ServiceName'.

during runtime.

Schema:

create table if not exists kanji (
    Id INTEGER PRIMARY KEY AUTOINCREMENT,
    Text TEXT NOT NULL,
    CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP
);

create table if not exists kanji_service_attributes (
    ServiceName TEXT NOT NULL,
    State INTEGER NOT NULL,
    KanjiId INTEGER NOT NULL,
    FOREIGN KEY (KanjiId) REFERENCES kanji(Id),
    PRIMARY KEY (ServiceName, State)
);

Create(...) members:

ctx.Main.Kanji.``Create(Text)`` // 👍
ctx.Main.KanjiServiceAttributes.``Create(KanjiId)`` // 😱

Intentionally brief issue for lack of time but I can create a full repro for ease of debugging later. Would appreciate if someone could give me a sanity check before I create the full repro to make sure it's not just me forgetting how Sqlite works.

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