Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass keyDecodingStrategy in first(decoding:) and all(decoding:) #161

Closed
wants to merge 1 commit into from

Conversation

valerianb
Copy link
Contributor

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-commenter
Copy link

codecov-commenter commented Jan 11, 2023

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%> (ø)

@gwynne
Copy link
Member

gwynne commented May 17, 2024

This was addressed by #172

@gwynne gwynne closed this May 17, 2024
@valerianb valerianb deleted the decoding-with-key-strategy branch May 21, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants