Commit Graph

19 Commits

Author SHA1 Message Date
Michael Kirk
4903815229 Remove Interaction.sortId column from GRDB
Instead back it from Interactin.id
2019-05-02 07:52:50 -06:00
Matthew Chen
3c18e298ac Fix issues around table creation, nested transactions. 2019-04-30 09:22:13 -04:00
Matthew Chen
2a2f18a571 Track "known" sticker packs. 2019-04-30 09:15:08 -04:00
Matthew Chen
785b91b01c Sketch out sticker management views. 2019-04-25 09:54:13 -04:00
Michael Kirk
b52bfd88bc HomeView backed by GRDB 2019-04-18 10:11:40 -06:00
Matthew Chen
5a9241c40c Fix rebase breakage. Update key-value store to support any. 2019-04-17 14:56:00 -04:00
Michael Kirk
7e399e65d8 Adapt Mapping to code-gen interactions 2019-04-16 10:53:50 -04:00
Matthew Chen
de59ec9100 Respond to CR - generate extensions for more classes. 2019-04-16 10:42:12 -04:00
Matthew Chen
76b87f214e Respond to CR. 2019-04-15 17:19:20 -04:00
Matthew Chen
41bc98761b Respond to CR. 2019-04-15 17:10:48 -04:00
Matthew Chen
731a5c799b Clean up rebase breakage. 2019-04-15 17:05:51 -04:00
Matthew Chen
e7f073530a Sketch out SDS cross process write handling. 2019-04-15 16:58:54 -04:00
Matthew Chen
4d390108bb Respond to CR. 2019-04-15 16:52:34 -04:00
Matthew Chen
a5a50e572d Add simple unit test around SDSDatabaseStorage, serialization, etc. 2019-04-11 11:58:44 -04:00
Matthew Chen
6ea3a321e0 Re-introduce the SDSTransaction classes; add "any" methods for save, fetch that discriminate transaction type. 2019-04-11 11:01:54 -04:00
Michael Kirk
0fe0dfc409 DO NOT MERGE - Slash and Burn
This is a POC whose primary goal was to have column values return DatabaseValueConvertible

We missed several non-convertible fields with just the threads class, we'll
miss others while developing the mgiration and in the future when adding
properties.

DatabaseValueConvertible is Swift only, but our SDSSerializable protocol was objc.

Though we weren't using the SDSSerializable methods in objc, we were taking
advantage of the fact that methods defined in @objc extensions can override
other methods defined in extensions on their superclass.

e.g. TSGroupThread can override `columnValues` and call super.columnValues even
though both are defined in extensions, because they are @objc extensions

This isn't allowed in Swift, because it's not safe (overrideing in an extension
can clobber another extension's method). There's an old proposal about adding a
limited safe form of the functionality to the language:

https://github.com/jrose-apple/swift-evolution/blob/overridable-members-in-extensions/proposals/nnnn-overridable-members-in-extensions.md

I'm not actually super concerned about the "unsafeness" of the extensions
approach in terms of clobbering methods, but because I want to leverage
Swift's DatabaseValueConvertible, we'd be forced to address it.

In this commit I kind of shuffle things around so that most of the SDS
serializing functionality is _not_ defined in an extension, but rather in a
parallel class hierarchy of Serializers.

SDSSerializable then becomes a very small protocol whose only responsibility is
to provide an instance of SDSSerializer.
2019-04-11 09:16:35 -04:00
Michael Kirk
47e12556aa Use SDSSerialization to create tables and insert in migration 2019-04-11 09:16:27 -04:00
Michael Kirk
ee3697793a GRDB adapter for message mapping 2019-04-10 16:28:18 -06:00
Michael Kirk
54311df296 Database Singleton, type erased transaction 2019-04-05 10:50:45 -06:00