sql-kit
sql-kit copied to clipboard
Allow to pass keyDecodingStrategy in first(decoding:) and all(decoding:)
When inserting, you can specify a keyEncodingStrategy:
try db.insert(into: myTable)
.model(myModel, keyEncodingStrategy: .convertToSnakeCase)
.run()
This change allows to pass a keyDecodingStrategy when using the convenience methods to decode models directly:
db.select()
.from(myTable)
.all(decoding: MyModel.self, keyDecodingStrategy: .convertFromSnakeCase)
Codecov Report
Merging #161 (baf26a3) into main (a5c3df4) will not change coverage. The diff coverage is
0.00%.
Additional details and impacted files
@@ Coverage Diff @@
## main #161 +/- ##
=======================================
Coverage 69.27% 69.27%
=======================================
Files 94 94
Lines 3486 3486
=======================================
Hits 2415 2415
Misses 1071 1071
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 69.27% <0.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| Sources/SQLKit/Builders/SQLQueryFetcher.swift | 28.94% <0.00%> (ø) |
This was addressed by #172