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

JSON fields are always escaped when using sql #11433

Open
1 task done
jlengstorf opened this issue Jul 8, 2024 · 0 comments
Open
1 task done

JSON fields are always escaped when using sql #11433

jlengstorf opened this issue Jul 8, 2024 · 0 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: db

Comments

@jlengstorf
Copy link
Contributor

Astro Info

Astro                    v4.11.5
Node                     v22.1.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             astro:db
                         @astrojs/db/file-url

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When using sql to select JSON fields, Astro returns escaped JSON even when using the SQL JSON() function. JSON fields are double escaped without the JSON() function.

What's the expected result?

JSON fields should be returned as parsed JSON for consistency with .select().

I probably don't have enough context to fix this myself, but I'm happy to submit the PR if someone can point at where the extra escaping is happening.

Link to Minimal Reproducible Example

https://github.com/jlengstorf/db-join-json-repro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jul 8, 2024
@Princesseuh Princesseuh added - P3: minor bug An edge case that only affects very specific usage (priority) pkg: db and removed needs triage Issue needs to be triaged labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: db
Projects
None yet
Development

No branches or pull requests

2 participants