Commit Graph
5831 Commits
Author SHA1 Message Date
Gwendal Roué d00421abe0 Restore SPM: add missing Foundation import 2018-08-15 17:17:08 +02:00
Gwendal Roué 4d343e893e More tests for Data -> String conversion: play with JPEG :-) 2018-08-15 17:09:15 +02:00
Gwendal Roué eba21d3371 Oh men of little faith! 2018-08-15 16:55:12 +02:00
Gwendal Roué b47f5864ac Even better feedback for conversion errors from StatementColumnConvertible 2018-08-15 16:49:07 +02:00
Gwendal Roué e8dacb31cc Tests for failed value conversions 2018-08-15 16:22:27 +02:00
Gwendal Roué 0b77d0d745 Better feedback for conversion errors from StatementColumnConvertible 2018-08-15 16:10:51 +02:00
Gwendal Roué de4f57c2aa Test decoding of non-UTF8 data 2018-08-15 16:09:45 +02:00
Gwendal Roué 2d6140a805 Refactor value conversion tests 2018-08-15 15:17:54 +02:00
Vlad Alexa b2234b46a2 5f41c57c addition 2018-08-15 14:04:14 +01:00
Gwendal Roué 358225b462 Cleanup, documentation, and preserve coding paths 2018-08-15 13:41:53 +02:00
Gwendal Roué 820673b78b PersistableRecord+Encodable: make it as robust as FetchableRecord+Decodable 2018-08-15 13:23:58 +02:00
Gwendal Roué 1c66ad4aad Restore GRDB/Core/Support/Foundation/Data.swift
because Data belongs to Foundation, not to the Standard Library.

Remove `import Foundation` from StandardLibrary.swift
2018-08-15 12:05:16 +02:00
Vlad Alexa 5f41c57c45 amended the documentation and tests to include Dictionary support to Codable types 2018-08-15 10:21:55 +01:00
Gwendal Roué 0cdc7d81d4 Just some cleanup, nothing new 2018-08-15 11:10:11 +02:00
Gwendal Roué 942b32e5d5 RowSingleValueDecodingContainer performance improvements
We switch from column indexing to integer indexing, which is far more efficient. And we can use the improved value decoding methods from #384.
2018-08-15 10:40:14 +02:00
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