Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count records on table #16

Closed
CatAnonymous opened this issue Apr 14, 2023 · 0 comments
Closed

Count records on table #16

CatAnonymous opened this issue Apr 14, 2023 · 0 comments

Comments

@CatAnonymous
Copy link

I tried

$query = $service->initializeQueryBuilder();

try{
    $listProducts = $query->select('COUNT(*)')
                ->from('messages')
                ->execute()
                ->getResult();
    var_dump($listProducts);
}
catch(Exception $e){
    echo $e->getMessage();
}

Result

Client error: `GET https://***.supabase.co/rest/v1/messages?select=COUNT(*)` resulted in a `400 Bad Request` response:
{"code":"PGRST200","details":"Searched for a foreign key relationship between 'messages' and 'COUNT' in the schema 'publ (truncated...)
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

No branches or pull requests

1 participant