From 86cff20f996858a03dc5159bed8b9d9d97ca586f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 4 Oct 2018 13:14:29 +0200 Subject: [PATCH] New suggested contribution: "Records: Splitting Database Encoding from Ability to Write in the Database" --- CONTRIBUTING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b3ddf374..eba0fbbcb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,6 +87,7 @@ The ideas, in alphabetical order: - [JSON] - [Linux] - [More SQL Generation] +- [Records: Splitting Database Encoding from Ability to Write in the Database] - [SQL Console in the Debugger] - [SQLCipher in a Shared App Container] - [Static Library] @@ -321,6 +322,19 @@ There are several SQLite features that GRDB could natively support: - [More ideas](https://www.sqlite.org/lang.html) +### Records: Splitting Database Encoding from Ability to Write in the Database + +:baby: Starter Task :pencil: Documentation + +Record types that know how to encode themselves in the database (converting themselves into columns and database values) currently are granted with [persistence methods] which can write in the database. Those record types all adopt the [PersistableRecord] protocol. + +But encoding a record grants other features, such as [Record Comparison], or [Requesting Associated Records]. + +This is a problem: one should not have to grant a type with persistence methods, when one just needs read-only features. + +The fix is to split database encoding from persistence methods. See [#426](https://github.com/groue/GRDB.swift/issues/426) for more information. + + ### SQL Console in the Debugger :question: Unknown Difficulty :hammer: Tooling @@ -396,6 +410,7 @@ Features that blur this focus are non-goals: [JSON]: #json [Linux]: #linux [More SQL Generation]: #more-sql-generation +[Records: Splitting Database Encoding from Ability to Write in the Database]: #records-splitting-database-encoding-from-ability-to-write-in-the-database [Non-Goals]: #non-goals [Report Bugs]: #report-bugs [RxGRDB]: http://github.com/RxSwiftCommunity/RxGRDB @@ -408,3 +423,7 @@ Features that blur this focus are non-goals: [Suggest an Enhancement]: #suggest-an-enhancement [Suggested Contributions]: #suggested-contributions [Typed Expressions]: #typed-expressions +[persistence methods]: README.md#persistence-methods +[PersistableRecord]: README.md#persistablerecord-protocol +[Record Comparison]: README.md#record-comparison +[Requesting Associated Records]: Documentation/AssociationsBasics.md#requesting-associated-records