stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.67k stars 1.56k forks source link

Codable insert support onConflict #951

Closed technocidal closed 3 years ago

technocidal commented 5 years ago

Simple addition to the codable api to pass a onConflict parameter to the insert function.

OzzyTheGiant commented 4 years ago

I'd like this merged in too. I have a project that needs to save batches of Codable objects by either inserting or updating during a transaction. Additionally, it would be nice if while inserting Codables, the library can transform an id of zero into the next available number in an autoincremented primary key, if this is not available already; I say that because my Codable objects have a non optional Int id so the default has to be 0 for brand new objects.

technocidal commented 3 years ago

@NathanFallet Thank you! I've been waiting for this day for so long. This was one of my first legit open source contributions and seeing it finally merged feels great!

nathanfallet commented 3 years ago

@johannesebeling Thanks for your contribution! This repository was inactive for a while, but I joined the maintainers team a few days ago, and I'm trying to review and merge pull requests, and respond to issues 😄 (it's a lot of work)