supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
1.04k stars 133 forks source link

Queries that contain a colon return null #371

Closed roboncode closed 1 year ago

roboncode commented 1 year ago

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

steve-chavez commented 1 year ago

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 } ] 
steve-chavez commented 1 year ago

@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.