PHP code example of programster / query-builder-pgsql-driver
1. Go to this page and download the library: Download programster/query-builder-pgsql-driver library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
programster / query-builder-pgsql-driver example snippets
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);