Skip to content

Querying JSON columns with the special symbols  #1656

@noskovvkirill

Description

@noskovvkirill

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Hi! We are trying to query the data from our jsonb column that has a special symbol @.
We are following the recommended spec by schema-dts

This is an example of code snippet we run:

   const { data, error } = await supabase
          .from('item')
          .select(
            `*, userId, media3Id(*), blockId!inner(*, media3Id!inner(*), consumptionId), newId, customData`,
          )
          .eq('media3Id->data->>schemaOrg2->>@type', schemaPrefix)
          .eq('userId', input.userId)
          .order('createdAt', { ascending: false });
        if (error) {

This is the result that we see

unexpected "@" expecting "-", digit or field name (* or [a..z0..9_$])

Is there anything that we are missing?

Screenshot 2023-11-16 at 12 03 42

To Reproduce

  1. Insert data into the jsonb column formatted as schema-dts with @type field
  2. Query the data by @type using supabase-js client

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas workaroundIssue has a valid workaround.postgrest-jsRelated to the postgrest-js library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions