supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.

Home Page:https://supabase.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Queries that contain a colon return null

roboncode opened this issue · comments

Bug report

Describe the bug

Performing the following query returns a null result.

A query using supabase-js that contains a colon (":") returns a null result.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

supabase.from('profile').select('*').eq('username', 'test:user').single()

Expected behavior

To work like SQL equivalent

select * from profile where username = 'test:user'

Screenshots

N/A

System information

  • OS: macOS 13.0.1
  • Version of supabase-js: 2.1.0
  • Version of Node.js: v16.15.1

Can't reproduce with plain curl calls or postgrest-js:

curl 'localhost:3000/projects?name=eq.foo:bar'

[{"id":6,"name":"foo:bar","client_id":null}]
const { PostgrestClient } = require('.')
const postgrest = new PostgrestClient('http://localhost:3000')

postgrest.from('projects').select('*').eq('name','foo:bar').
then(({ data, error }) => console.log(data, error))

[ { id: 6, name: 'foo:bar', client_id: null } ] 

@roboncode I suggest to try different eq values and see if it's indeed a problem with colons or maybe no result is returned due to RLS.