rafaelwendel / phpsupabase

PHP Client to use Supabase
MIT License
187 stars 18 forks source link

Add limit in QueryBuilder please #21

Closed streeboga closed 1 year ago

streeboga commented 1 year ago

Add limit in QueryBuilder please

  if(isset($this->query['limit'])){
        $queryString .= '&limit=' . $this->query['limit'];
    }

/**
 * Add the "limit" to the query
 * @access public
 * @param $range String The interval of fetch registers
 * @return QueryBuilder
 */
public function limit(string $range) : QueryBuilder
{
    $this->query['limit'] = $range;
    return $this;
}

Database.php in createCustomQuery()

    if(isset($args['limit'])){
        $queryBuilder->limit($args['limit']);
    }
rafaelwendel commented 1 year ago

Hello @streeboga

Thanks for your contribution. I published a new release (0.0.6) with your suggestions (I mentioned you in the credits).

=)