How do you define the conflict action when inserting a Codable object?

Open
#812 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
20/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
sqlite, swift
Domain
databases

Research direction

Start from the Codable insertion call, try db.run(codableObject), and compare it with the explicitly configured table.insert(or: OnConflict.replace, ...) form shown in the issue. Check the insertion API documentation and relevant implementation entry points to determine whether conflict behavior is supported for Codable objects; done means the supported usage or required documentation change is clearly identified.

Written by the indexing model from the issue text.

Description

question

Issues are used to track bugs and feature requests.
Need help or have a general question? Ask on Stack Overflow (tag sqlite.swift).

Build Information

Using SQLite.swift (0.11.5) using CocoaPods
Using Xcode 9.3

General guidelines

I can insert Codable objects fine using the below syntax:

try db.run(codableObject)

How do I define what to do with a conflict?
With non-Codable objects, I do:

try db.run(table.insert(or: OnConflict.replace, id <- tile.id))

Dominant language
Swift
Stars
10.2k
Forks
1.6k
Avg merge
6d 2h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

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 stephencelis/SQLite.swift

All issues in stephencelis/SQLite.swift

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.