You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on creating a SQLiteEncoder and a SQLiteDecoder so that I can insert and retrieve objects from the database by simply implementing the Codable and Decodable protocols introduced in Swift 4. I originally implemented this outside of the library with my own Coding protocols and I am in the process of converting it to use Swift 4 Coding protocols instead of my custom ones. I was originally going to leave this outside of the framework but I discovered I will need internal access to some of the objects.
The Plan
I do not plan to support relationships between objects or anything like that.
The SQLiteEncoder will essentially just generate a list of setters for the encodable object. I will probably add a convenience insert method like insert<V: Encodable>(_ encodable: V) -> SQLite.Insert to QueryType that accepts an Encodable type and calls insert with the generated setters
SQLiteDecoder will just do a series of gets on a provided row. I will probably add a method to Row like decode<V: Decodable>() throw -> V.
The coders will simply convert all non-native types to and from JSON data
Is anyone already attempting this or think that this is an undesirable feature inside this framework?
The text was updated successfully, but these errors were encountered:
I am working on creating a
SQLiteEncoder
and aSQLiteDecoder
so that I can insert and retrieve objects from the database by simply implementing theCodable
andDecodable
protocols introduced in Swift 4. I originally implemented this outside of the library with my own Coding protocols and I am in the process of converting it to use Swift 4 Coding protocols instead of my custom ones. I was originally going to leave this outside of the framework but I discovered I will need internal access to some of the objects.The Plan
insert<V: Encodable>(_ encodable: V) -> SQLite.Insert
to QueryType that accepts an Encodable type and calls insert with the generated settersRow
likedecode<V: Decodable>() throw -> V
.Is anyone already attempting this or think that this is an undesirable feature inside this framework?
The text was updated successfully, but these errors were encountered: