Expression<Int64> is broken
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start with Expression.swift around line 110 and reproduce the reported behavior under Xcode 16.2 using Expression(value: "id") and the t.column example. Compare the resulting SQLite schema and expression type with the expected INTEGER and Expression; done means the examples compile and produce the stated types and schema.
Written by the indexing model from the issue text.
Description
Running v0.15.3 under Xcode 16.2
Under Usage:
let id = Expression("id")
t.column(id, primaryKey: true)
is suppose to translate to the query clause
"id" INTEGER PRIMARY KEY NOT NULL
Instead it is translated to
"id" TEXT PRIMARY KEY NOT NULL
Note: Under Xcode 16, it now necessary to include the argument label 'value.
let id = Expression(value: "id")
After executions id is
id SQLite.Expression
when it should be
id SQLite.Expression
The problem is the code base takes its UnderlyingType from "id", which is a String,
not from . See Expression.swift, line 110.
The fact Expression is translated to TEXT is further exemplified by
the following code which will no longer compile:
enum booleans: Int64 {
case TRUE = 1, FALSE = 0
}
let isActive = Expression(value: "isActive")
t.column(isActive, defaultValue: booleans.TRUE.rawValue)
results in the compiler error:
Cannot convert value of type 'Expression' to expected argument type 'Expression<Int64?>'
- Dominant language
- Swift
- Stars
- 10.2k
- Forks
- 1.6k
- Avg merge
- 6d 2h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stephencelis/SQLite.swift
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
stephencelis/SQLite.swift#1375 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
stephencelis/SQLite.swift#1293 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
stephencelis/SQLite.swift#1347 · 7 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
stephencelis/SQLite.swift#1338 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
stephencelis/SQLite.swift#1337 · 3 comments ·
All issues in stephencelis/SQLite.swift
Similar issues
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
skiptools/skip-fuse-ui#147 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OneBusAway/onebusaway-ios#1438 · 1 reaction ·