sqlite - ``Create(...)`` function is incorrect

Open
#841 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, sqlite
Domain
databases

Research direction

Start at the SQLite Create(...) entry points described in the issue and reproduce the failure with the supplied schema, especially the kanji_service_attributes table. Trace why Create(KanjiId) omits the required NOT NULL columns; the work is done when creation succeeds for this schema without the reported constraint error.

Written by the indexing model from the issue text.

Description

sqlite

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.

Dominant language
F#
Stars
627
Forks
147
Avg merge
2h 2m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/SQLProvider

All issues in fsprojects/SQLProvider

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.