Support for UNION
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading the documented “Executing Arbitrary SQL” approach and the query-building API used for JOINs. Determine how UNION inside a JOIN should be represented and how the resulting row can be passed to TableAObj; done means the feature or a documented workaround covers this query and its row type.
Written by the indexing model from the issue text.
Description
I came across a use case where I need to write somewhat complex query using UNION inside the JOIN. The query looks something like below:
SELECT
*
FROM
table_a a
JOIN table_b b ON b.a_id = a.id
JOIN (
SELECT id, val FROM table_c
UNION
SELECT id, val FROM table_d
) as e ON e.id = a.id
I don't believe UNION is supported yet. Can I ask a feature request for it?
If it's not possible (or while UNION is not implemented yet or is being implemented), can you suggest me a work-around? I tried using "Executing Arbitrary SQL" way as documented, but I can't find out the type of row in the snippet below. Ideally I'd like to pass row to my model for object generation.
let stmt = try db.prepare("SELECT * FROM table_a a JOIN table_b b ON b.a_id = a.id")
for row in stmt {
let tableAObj = TableAObj(row)
}
- 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 ·