Replies: 4 comments 8 replies
-
Hello @hell001, Please show how you define this name/title |
Beta Was this translation helpful? Give feedback.
-
Hello @groue, Assuming you are not referring to any of the code in the original post,
|
Beta Was this translation helpful? Give feedback.
-
Whenever someone asks for support, I always refer to the actual code that creates the actual problem. Everything else is just noise. Your answer does not contain any I'm not sure I can help with the available information. If you want help from this discussion, please provide a Minimal, Reproducible Example. |
Beta Was this translation helpful? Give feedback.
-
does the following code from my original post not include a column value? (quoted below for your convenience)
|
Beta Was this translation helpful? Give feedback.
-
What did you do?
I have an API that has a
title
key, but in my code I'd like to have it namedname
. I create aCodingKeys
enum so that my app can properly read the JSON and also use the variable name I choose. See a truncated version of the class below:As per Define Record Requests, I created a
Columns
enum as follows below. However, instead of using the CodingKeys valueCodingKeys.name
, I used the String of the variable name itself, which is what I desire the column name to be.So to clarify, I still would like to use
CodingKeys
to go fromtitle
from API response toname
in Swift code, but still want to usename
as the GRDB column name, and not take it fromCodingKeys
, which would betitle
.For extra clarification, the errors occur on my
aInstance.insert(db)
calls.table a has no column named title
What did you expect to happen?
The column name is
name
.What happened instead?
The column name is
title
.Environment
GRDB flavor(s): GRDB
GRDB version:
Installation method: SPM
Xcode version:
Swift version: 5
Platform(s) running GRDB: iOS
macOS version running Xcode: 11.0
Beta Was this translation helpful? Give feedback.
All reactions