Commit Graph

30 Commits

Author SHA1 Message Date
Michael Kirk
3ec1aa098d respect "optional" in db schema 2019-04-17 08:58:37 -06:00
Matthew Chen
1514a332c6 Ignore more classes. 2019-04-16 17:09:26 -04:00
Matthew Chen
9c804e8819 Ignore more classes. 2019-04-16 16:57:17 -04:00
Matthew Chen
51d20c1970 Define cursor-based fetch methods in SDS extensions. 2019-04-16 13:08:47 -04:00
Matthew Chen
409bbb0e92 Respond to CR. 2019-04-16 13:01:11 -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
f51f58fd29 Respond to CR - generate extensions for more classes. 2019-04-16 10:31:25 -04:00
Matthew Chen
edc41a6303 Respond to CR - generate extensions for more classes. 2019-04-16 10:11:29 -04:00
Matthew Chen
9b6457d6a2 Respond to CR. 2019-04-16 09:35:19 -04:00
Matthew Chen
2bfcb6d26b Clean up ahead of PR. 2019-04-16 09:03:07 -04:00
Matthew Chen
384457fefc Sketch out SDS extensions for interaction models. 2019-04-16 09:03:07 -04:00
Matthew Chen
56ee5d7ff2 Respond to CR. 2019-04-16 09:01:47 -04:00
Matthew Chen
fffc13cde3 Code generate remove() method for SDS models. 2019-04-16 09:01:47 -04:00
Michael Kirk
2038709a6f Fix MessageMapping 2019-04-15 17:41:13 -06: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
013463566b Respond to CR. 2019-04-11 13:43:02 -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
Matthew Chen
9356ded707 Update code generation to reflect fixes from Michael's branch. 2019-04-11 10:21:57 -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
916cc0706d adapt to new transaction naming scheme 2019-04-11 09:16:11 -04:00
Matthew Chen
5ca2991f0c Sketch out the SDS code generation.
* Copy SDS code generation and utility files from playground.
2019-04-11 09:15:28 -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