Skip to content

Conversation

@bean1352
Copy link
Contributor

Added comprehensive guide for querying JSON data in the client SQLite database

  • Explains JSON storage as strings in SQLite when synced from backend (MongoDB, PostgreSQL, MySQL)
  • Documents -> vs ->> operators with clear examples showing quoted vs unquoted output
  • Covers json_extract() and json_each() for flattening and querying nested arrays/objects
  • Includes real-world examples: filtering, aggregating etc
  • Shows delimiter-separated value queries using instr() pattern
  • Performance optimization tips: indexing JSON columns in AppSchema, filtering before expanding, using EXISTS
  • Documents common gotchas: NULL handling, type casting
  • Provides reference for useful JSON functions (json_array_length, json_valid, json_type, etc.)

@bean1352 bean1352 requested review from benitav and rkistner November 26, 2025 10:43
@benitav
Copy link
Collaborator

benitav commented Nov 26, 2025

this is great! 🔥 One suggestion I have is to link to this reference from other places in the docs where this use case would come up, e.g. two that come to mind are https://docs.powersync.com/usage/use-case-examples/custom-types-arrays-and-json (maybe even consolidate these 2 pages as there seems to be a lot of overlap), and where we mention JSON on https://docs.powersync.com/usage/sync-rules/types

…ate text column reference and add links for further information on JSON handling and database type mapping.
@michaelbarnes michaelbarnes self-requested a review December 1, 2025 15:28
Copy link
Contributor

@michaelbarnes michaelbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is a great addition. I've left a few comments around wording and a few links back to SQLite docs for easy reference.

… links to relevant SQLite functions for better user guidance.
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.

4 participants