AutoIncrement not Working with Current Build

Open
#641 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
databases

Research direction

Start by reproducing the issue with the MyQueue model and database.CreateTable() on Android and iOS. Inspect whether the created table enforces the PrimaryKey and AutoIncrement attributes, then verify completion by confirming inserted rows receive valid generated IDs and reject invalid primary-key behavior.

Written by the indexing model from the issue text.

Description

I have a model declared as such:

public class MyQueue
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Eval { get; set; }
public bool Delivered { get; set; }
}

I am using database.CreateTable(); to create the table and yet the AutoIncrement and PrimaryKey flags are being completely ignored on Android and iOS in my XF app. I can insert as many items in this table as I want with null Id or Id of 0 (neither of which should be okay).

Dominant language
C#
Stars
4.5k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

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 praeclarum/sqlite-net

All issues in praeclarum/sqlite-net

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.