programster / query-builder-pgsql-driver
A PostgreSQL driver for the programster/query-builder-parser package.
1.0.1
2024-03-21 12:16 UTC
Requires
- php: >=8.1
- ext-pgsql: *
- programster/pgsql-lib: 1.0.*|2.0.*
- programster/query-builder-parser: 1.0.*
Requires (Dev)
- irap/autoloader: 1.0.*
- programster/core-libs: ^2.1
README
A PostgreSQL driver for the query builder parser PHP package. This will result in the parser converting the JSON output into SQL statements appropriate for your PostgreSQL database.
Example Usage
use Programster\QueryBuilderPgsqlDriver\PgSqlDriver; use Programster\QueryBuilderParser\Parser; $pgsqlDriver = new PgSqlDriver($conn); // $conn being return from pg_connect() $parser = new Parser($pgsqlDriver); // outputs something like: "name" = 'bob' AND "username" LIKE '%yolo%' $whereCondition = $parser->getSql($jsonString); // outputs something like: SELECT * FROM "users" WHERE "name" = 'bob' AND "username" LIKE '%yolo%'; $selectStatement = $parser->getSelectStatement("users", $jsonString);