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

[Feature Request] json_array_append #1374

Open
HarryCordewener opened this issue Sep 24, 2021 · 0 comments
Open

[Feature Request] json_array_append #1374

HarryCordewener opened this issue Sep 24, 2021 · 0 comments

Comments

@HarryCordewener
Copy link
Contributor

HarryCordewener commented Sep 24, 2021

Expose SQLite's ability to group arrays so we can append one array to another. There is a common need to add one array to another.

json_array_append(<jsonarray1>,<jsonarray2>)

Append two arrays and return the resulting array. 

Examples:
> &a1 me=[1,2,3]
> &a2 me=[4,5,6]
> say json_array_append(v(a1),v(a2))
You say, "[1,2,3,4,5,6]"

SQLite code:

SELECT json_group_array(value) FROM
	(SELECT * FROM json_each('[1,2,3,4,99]') 
    UNION ALL SELECT * FROM json_each('[5]'))
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

No branches or pull requests

1 participant