Commit Graph
3061 Commits
Author SHA1 Message Date
Gwendal Roué aa8bc0fae3 Don't let JSONDecodingRequiredError go
JSON decoding: when row doesn't contain any Data, we don't want to expose a JSONDecodingRequiredError error to the user. We switch to a detailed conversion error instead (see #384).
2018-08-15 10:24:28 +02:00
Gwendal Roué 275098084d Introduce JSONDecodingRequiredError
We used to check for a standard DecodingError.typeMismatch error with specific message before switching to JSON decoding.

There was a small risk that such an error would not be generated by GRDB. In this case, we'd erroneously switch to JSON decoding instead of throwing the error.

So let's recognize the specific need for JSON decoding with a specific error instead: JSONDecodingRequiredError.
2018-08-15 10:12:28 +02:00
Gwendal Roué 05fda18a56 Introduce RowSingleValueDecoder
This allows complex decodable types to fail decoding from a row column, so that we switch to JSON decoding.
2018-08-15 09:55:45 +02:00
Gwendal Roué 4b7f17dbfa Merge remote-tracking branch 'origin/development' into rotacloud 2018-08-15 05:12:28 +02:00
Angus Muller c52b59f1bc Switching to JSON encoding for nested containers. 2018-08-14 16:01:05 +01:00
Vlad Alexa 76f5adf944 moved the extension to Swift.Data to follow the extension to Swift.String in the StandardLibrary.swift,
added case .blob(let data): return String(data: data, encoding: .utf8) to String.fromDatabaseValue
fixed tests
2018-08-14 15:04:07 +01:00
Vlad Alexa d81475adc4 6262d10 continued 2018-08-14 13:06:26 +01:00
Angus Muller 8c06e7bff5 Detached rows string to data and tests 2018-08-14 11:16:47 +01:00
Vlad Alexa 6262d10794 added catch 2018-08-14 09:25:44 +01:00
Gwendal Roué d9dd293d7f A really difficult cleanup process 2018-08-14 08:33:06 +02:00
Gwendal Roué e49e2db571 Optimize decoding of StatementColumnConvertible values in Decodable records
This is the real final touch for #384, after all
2018-08-13 21:17:52 +02:00
Gwendal Roué 9bc68cd10e The final touch 2018-08-12 15:12:46 +02:00
Gwendal Roué 66541922a4 More cleanup 2018-08-12 12:27:47 +02:00
Gwendal Roué 80fe7f87b1 More cleanup 2018-08-12 11:39:48 +02:00
Gwendal Roué bf5420de26 More cleanup 2018-08-12 10:20:10 +02:00
Gwendal Roué ef10e2e8ed General cleanup:
- rename ValueConversionDebuggingInfo to ValueConversionContext
- allow missing value conversion context (when decoding a raw DatabaseValue)
- rename ColumnCursor to FastDatabaseValueCursor
- rename NullableColumnCursor to FastNullableDatabaseValueCursor
2018-08-11 19:45:58 +02:00
Gwendal Roué 1dcb42c540 wip: debug info for no such column errors 2018-08-11 13:03:11 +02:00
Gwendal Roué 897fd32725 Cleanup 2018-08-11 12:58:04 +02:00
Gwendal Roué e46902c845 wip: debug info for no such column errors 2018-08-11 07:16:55 +02:00
Gwendal Roué d836fffd08 wpi: debug info for no such column errors 2018-08-10 08:52:32 +02:00
Gwendal Roué 9f2058f6d9 Fix DatabaseValueConvertible implementation for Decodable types that need a single-value container 2018-08-10 05:01:30 +02:00
Gwendal Roué 7d4ebce70a TODO conversion error message for adapted rows 2018-08-10 04:52:59 +02:00
Gwendal Roué cbda1f9211 Fix DatabaseValueConvertible implementation for Decodable types that need a single-value container
They used to crash on decoding errors
2018-08-10 04:52:23 +02:00
Gwendal Roué 220ce379e1 Test conversion error messages 2018-08-09 14:00:33 +02:00
Vlad Alexa 2826472c19 sorted encoder outputFormatting for ios11+ etcl 2018-08-09 09:46:45 +01:00
Gwendal Roué bcc45dc076 no more throwing conversion methods, and refactor ValueConversionDebuggingInfo 2018-08-09 08:51:50 +02:00
Vlad Alexa 7def60c3c0 fixed checking for nested codable 2018-08-08 14:35:05 +01:00
Vlad Alexa 74aae3dd59 implemented requested changes 2018-08-08 11:41:26 +01:00
Vlad Alexa feeedcb92d Added nested Codable support by flattening into/from JSON 2018-08-07 15:29:16 +01:00
Gwendal Roué 78a6f7251b Spot a few Demeter law violations 2018-08-06 13:40:37 +02:00
Gwendal Roué 9f2ba7245b fix SPM build 2018-08-06 13:40:05 +02:00
Gwendal Roué e9e1fa85c6 Cleanup 2018-08-06 13:40:05 +02:00
Gwendal Roué f8de01779c Cleanup 2018-08-06 13:40:05 +02:00
Gwendal Roué 84c53ef6b9 improve value conversion diagnostics more 2018-08-06 13:40:05 +02:00
Gwendal Roué a8f6ed6d61 improve value conversion diagnostics more 2018-08-06 13:40:05 +02:00
Gwendal Roué 1c811a61ca improve value conversion diagnostics 2018-08-06 13:40:05 +02:00
Gwendal Roué d21a9b90b2 Enable FTS5 for SQLite < 3.20.0 (sqlite3_prepare_v3 and sqlite3_bind_pointer) 2018-08-03 08:24:25 +02:00
Gwendal Roué d4590ff91f Fix DatabaseWriter.readFromCurrentState documentation 2018-07-13 09:45:59 +02:00
Gwendal Roué 91d0a453da DatabaseWriter.erase(): more robust error handling 2018-07-07 17:43:26 +02:00
Gwendal Roué 3593806685 Cleanup 2018-07-07 14:49:43 +02:00
Gwendal Roué e84b539de2 DatabaseWriter.erase(): don't mess with internal SQLite objects 2018-07-07 14:42:18 +02:00
Gwendal Roué fee4486d1b DatabaseMigrator.eraseDatabaseOnSchemaChange 2018-07-07 14:23:50 +02:00
Gwendal Roué a73be9c010 Fix databaseWriter.erase() with SQLCipher 2018-07-07 12:32:40 +02:00
Gwendal Roué a465f16ff7 databaseWriter.erase(), databaseWriter.vacuum() 2018-07-06 13:58:55 +02:00
Gwendal Roué 86d93b11dd Easier database backup invocation 2018-07-06 13:57:55 +02:00
Gwendal Roué ca7df229fa Cleanup 2018-07-03 18:44:42 +02:00
Gwendal Roué 0ed4491b46 Prepare for SE-0206 "Hashable Enhancements" 2018-06-17 15:23:23 +02:00
Gwendal Roué 38b1e41aab Final tweaks to dispatch queue labels 2018-06-14 21:10:56 +02:00
Gwendal Roué e81e818305 Confiiguration.label documentation 2018-06-14 20:47:43 +02:00
Gwendal Roué 342dcc5094 Confiiguration.label is used to name dispatch queues 2018-06-14 20:26:34 +02:00