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

[DO NOT MERGE] demo feat: json_object support #2242

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chloeminkyung
Copy link
Contributor

@chloeminkyung chloeminkyung commented Nov 30, 2023

SELECT JSON_OBJECT('id: user.id', 'town: user.town', 'town_2: LA') as info FROM users

{"id": 1, "town": "Bristol", "town_2": "LA"}

@chloeminkyung chloeminkyung requested a review from chubei November 30, 2023 07:44
@chloeminkyung chloeminkyung marked this pull request as draft November 30, 2023 07:46
@Jesse-Bakker
Copy link
Contributor

Jesse-Bakker commented Nov 30, 2023

The syntax is a bit unusual. Can we use the SQL/JSON standard syntax instead?
Ex.:

select JSON_OBJECT('id': user.id, 'town': user.town, 'town_2': 'LA')

and/or

select JSON_OBJECT('id' VALUE user.id, 'town' VALUE user.town, 'town_2' VALUE 'LA')

On advantage is that there is a clear distinction between value literals 'LA' and column references user.id.

More info: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_OBJECT.html#GUID-1EF347AE-7FDA-4B41-AFE0-DD5A49E8B370

@chloeminkyung
Copy link
Contributor Author

chloeminkyung commented Nov 30, 2023

The syntax is a bit unusual. Can we use the SQL/JSON standard syntax instead? Ex.:

select JSON_OBJECT('id': user.id, 'town': user.town, 'town_2': 'LA')

and/or

select JSON_OBJECT('id' VALUE user.id, 'town' VALUE user.town, 'town_2' VALUE 'LA')

On advantage is that there is a clear distinction between value literals 'LA' and column references user.id.

More info: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_OBJECT.html#GUID-1EF347AE-7FDA-4B41-AFE0-DD5A49E8B370

yes, we are aware of that - this is hacky way to implement this feature as fast as possible, request from Bei for demo purpose. Not merging for main, of course. I have implemented this way cause of our backend limitation. We should take one of your approaches when we are implementing properly later on.

@chloeminkyung chloeminkyung changed the title feat: json_object support demo feat: json_object support Nov 30, 2023
@chloeminkyung chloeminkyung changed the title demo feat: json_object support [DO NOT MERGE] demo feat: json_object support Nov 30, 2023
@chubei chubei removed their request for review March 14, 2024 01:00
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.

2 participants