-
Notifications
You must be signed in to change notification settings - Fork 30
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
RawRepresentable not supported in SQLite #45
Comments
Hey @jeremyquinn, this is something we should definitely support! Maybe we could have a protocol that the enum has to implement so it can be used in the ORM? Could you open a PR with your prototype? |
Hi @EnriqueL8, glad to know you are interested. The only way I have managed to make this work so far, is to be specific about the type of the My guess is that an implementation for Enums can already be made I want to test this extension has no effect on normal |
Added PR #46 Sorry, it looks like my last PR got mixed in ... |
Is there still a plan to include this in the near future? I'm running into the same issues. |
Seems it is still broken... I realized that somehow DatabaseEncoder only supports types that do not need any mapping/encoding:
when value is an enum type, then
|
Context and Description
As I mentioned in Issue #42, I get errors encoding and decoding Enums which are
RawRepresentable
&Codable
.I have a tentative solution but at the moment is is per
RawType
, so would likely be user-specific.Maybe this could be added to your codebase as an example or to your documentation.
Here is the solution for
Int
basedenum
,String
etc. is equally trivial.Environment Details
Information about your OS, Swift version and Xcode version if on macOS.
MacOS 10.13.4
Xcode 9.4
Kitura 2.4.1
SwiftKuery 1.3.1
SwiftKueryORM 0.1.1
SwiftKuerySQLite 1.0.0
Steps to Reproduce
Model struct contains enum :
The text was updated successfully, but these errors were encountered: