supabase-go
supabase-go copied to clipboard
Query data that includes '@' is not able to be found
i tried querying an email for example
` // FindAccount retrieves an account by email from the "accounts" table. func FindAccount(client *supabase.Client, email string) (map[string]interface{}, error) { var results []map[string]interface{}
err := client.DB.From("accounts").Select("*").Eq("email", email).Execute(&results)
log.Info(results)
if err != nil {
return nil, err
}
if len(results) == 0 {
return nil, nil
}
return results[0], nil
}
`
but it keeps returning an empty mapping but when there isnt any symbols it works and it was found. is there something i need to do to handle this kind of things ?
I faced the exact same issue and I solved it by using Filter instead of Eq.
You can try doing this -
err := client.DB.From("accounts").Select("*").Filter("email", "eq", email).Execute(&results)
log.Info(results)
if err != nil {
return nil, err
}
if len(results) == 0 {
return nil, nil
}
return results[0], nil