Generated/Virtual Columns - How to define it #10706
Replies: 3 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.
-
how come there's no documentation on the official reference for this use case, per chatGPT documentation...:
|
Beta Was this translation helpful? Give feedback.
-
i wrote some documentation on this topic in #11834 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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