Generated/Virtual Columns - How to define it #10706
Unanswered
acrsouza
asked this question in
Support Questions
Replies: 2 comments 1 reply
-
Based on this example I found in the Generated/Virtual Columns PR
I implemented the following:
Seems to be working fine, but I'm not sure if it is the right way to implement it. |
Beta Was this translation helpful? Give feedback.
1 reply
-
how come there's no documentation on the official reference for this use case, per chatGPT documentation...:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, there.
I couldn't find the in the docs neither in Google the correct way to define generated columns in the mapping.
What I want to achieve is this:
ALTER TABLE events ADD country_code VARCHAR(2) GENERATED ALWAYS AS (content->>"$.country_code");
What I've tried in my XML mapping:
This generates the following SQL:
ALTER TABLE events ADD country_code AS (content->>"$.country_code");
As you can see, it's missing the type of the field and the GENERATE ALWAYS statement.
Can someone tell me the correct way to define this column, please?
I will gladly update the documentation afterwards.
Beta Was this translation helpful? Give feedback.
All reactions