Skip to content

Fix id column type in documentation example schema to prevent error#322

Merged
mbrandonw merged 1 commit into
pointfreeco:mainfrom
RobbieClarken:docs-int-to-integer
Dec 5, 2025
Merged

Fix id column type in documentation example schema to prevent error#322
mbrandonw merged 1 commit into
pointfreeco:mainfrom
RobbieClarken:docs-int-to-integer

Conversation

@RobbieClarken
Copy link
Copy Markdown
Contributor

When the id column is defined as INT NOT NULL PRIMARY KEY AUTOINCREMENT sqlite will throw an error:

AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY

This is fixed by changing INT to INTEGER. I also changed the other columns for consistency.

The error was being thrown for sqlite-data 1.4.0, iOS 26.1.

When the `id` column is defined as `INT NOT NULL PRIMARY KEY AUTOINCREMENT`
sqlite will throw an error:

> AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
Copy link
Copy Markdown
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @RobbieClarken, good catch!

@mbrandonw mbrandonw merged commit caa37bb into pointfreeco:main Dec 5, 2025
mbrandonw pushed a commit that referenced this pull request Dec 5, 2025
…322)

When the `id` column is defined as `INT NOT NULL PRIMARY KEY AUTOINCREMENT`
sqlite will throw an error:

> AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
mbrandonw added a commit that referenced this pull request Dec 8, 2025
* Private tables should always be saved in private db.

* snapshots

* Handle shared database more correctly.

* wip

* fix test

* add another test

* Update Tests/SQLiteDataTests/CloudKitTests/MockCloudDatabaseTests.swift

* Fix id column type in documentation example schema to prevent error (#322)

When the `id` column is defined as `INT NOT NULL PRIMARY KEY AUTOINCREMENT`
sqlite will throw an error:

> AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY

* fixes

* format

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Robbie Clarken <last.gem5797@invariance.io>
bok- pushed a commit to bok-/sqlite-data-with-traits that referenced this pull request Dec 15, 2025
…ointfreeco#322)

When the `id` column is defined as `INT NOT NULL PRIMARY KEY AUTOINCREMENT`
sqlite will throw an error:

> AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
bok- pushed a commit to bok-/sqlite-data-with-traits that referenced this pull request Dec 15, 2025
* Private tables should always be saved in private db.

* snapshots

* Handle shared database more correctly.

* wip

* fix test

* add another test

* Update Tests/SQLiteDataTests/CloudKitTests/MockCloudDatabaseTests.swift

* Fix id column type in documentation example schema to prevent error (pointfreeco#322)

When the `id` column is defined as `INT NOT NULL PRIMARY KEY AUTOINCREMENT`
sqlite will throw an error:

> AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY

* fixes

* format

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Robbie Clarken <last.gem5797@invariance.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants