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
a08974ffa4
Added tests for arrays
2018-08-14 11:20:02 +01:00
Angus Muller
8c06e7bff5
Detached rows string to data and tests
2018-08-14 11:16:47 +01:00
Vlad Alexa
7f16e357d0
extended Codable documentation and added test for the example used in the documentation
2018-08-14 10:39:31 +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é
7da5ff95a0
Makefile: fix rule for Realm
2018-08-13 07:51:13 +02:00
Gwendal Roué
8eee52dad5
Merge pull request #384 from groue/conversionDebugInfo
...
Improve database value decoding diagnostics
2018-08-13 07:45:32 +02:00
Gwendal Roué
9bc68cd10e
The final touch
2018-08-12 15:12:46 +02:00
Gwendal Roué
e415a93d7e
Performance tests for Codable records
2018-08-12 14:10:38 +02:00
Gwendal Roué
46bba98f0f
Fix versions in performance report
2018-08-12 13:43:39 +02:00
Gwendal Roué
6a21e97a12
Profile struct decoding
2018-08-12 13:43:16 +02:00
Gwendal Roué
1ae8e39dab
Perform performance tests against SQLite.swift 0.11.5
2018-08-12 12:46:51 +02:00
Gwendal Roué
b99b14eb4d
Perform performance tests against FMDB 2.7
2018-08-12 12:45:02 +02:00
Gwendal Roué
5579dd651a
Perform performance tests against Realm 3.7.6
2018-08-12 12:42:58 +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é
c480e07f08
Increase single-value containers testing
2018-08-10 05:21:33 +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é
cef5d25228
Test conversion error messages
2018-08-09 19:19:22 +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
Gwendal Roué
89d5bd7945
Restore SQLCipher/src to v3.4.2
2018-08-07 19:44:38 +02: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é
b307e907cb
CHANGELOG
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