Skip to content

Pgsql

Properties

driverName

public string $driverName

Methods

buildDsn

public static buildDsn(array $config): string
  • This method is static.

Parameters:

Parameter Type Description
$config array

listTables

Get an array of table names from the connection.

public listTables(): array

Return Value:

tables names.


listDatabases

Get an array of database names from the connection.

public listDatabases(): array

Return Value:

database names.


listFields

Get an array of table fields from a table.

public listFields(mixed $table): array

Parameters:

Parameter Type Description
$table mixed

Return Value:

field arrays


Inherited methods

quoteIdentifier

public quoteIdentifier(string $identifier): string

Parameters:

Parameter Type Description
$identifier string

quote

Quote a value for an SQL query.

public quote(float|array|bool|int|string|null $value = null): int|string

Objects passed to this function will be converted to strings. Expression objects will use the value of the expression. Query objects will be compiled and converted to a sub-query. Fnc objects will be sent of for compiling. All other objects will be converted using the __toString method.

Parameters:

Parameter Type Description
$value float|array|bool|int|string|null any value to quote

__construct

public __construct(array $config): mixed

Parameters:

Parameter Type Description
$config array

createPdo

protected createPdo(array $config): \PDO

Parameters:

Parameter Type Description
$config array

getDsn

Returns the DSN associated with this connection

public getDsn(): string|null

query

Execute a query

public query(string $sql, array $params = []): \Qubus\Expressive\ResultSet

Parameters:

Parameter Type Description
$sql string SQL Query.
$params array (optional) Query params.

command

Execute a non-query SQL command.

public command(string $sql, array $params = []): bool

Parameters:

Parameter Type Description
$sql string SQL Command.
$params array (optional) Command params.

affectedRows

Execute a query and return the number of affected rows.

public affectedRows(string $sql, array $params = []): int

Parameters:

Parameter Type Description
$sql string SQL Query.
$params array (optional) Query params.

column

Execute a query and fetch the first column

public column(string $sql, array $params = []): mixed

Parameters:

Parameter Type Description
$sql string SQL Query
$params array (optional) Query params

queryBuilder

public queryBuilder(): \Qubus\Expressive\QueryBuilder

getDriver

Returns the driver's name.

public getDriver(): string|null

getSchema

Returns the schema associated with this connection

public getSchema(): \Qubus\Expressive\Schema

schemaCompiler

Returns an instance of the schema compiler associated with this connection

public schemaCompiler(): \Qubus\Expressive\Schema\Compiler

Throws:


inTransaction

public inTransaction(): bool

startTransaction

Start a transaction.

public startTransaction(): static

commitTransaction

public commitTransaction(): static

rollbackTransaction

public rollbackTransaction(): static

transaction

Run transactional queries.

public transaction(\Closure $callback, mixed $that = null, mixed $default = null): mixed

Parameters:

Parameter Type Description
$callback \Closure transaction callback
$that mixed
$default mixed

Throws:


setCharset

Sets the connection encoding.

protected setCharset(string $charset): void

Parameters:

Parameter Type Description
$charset string Encoding.

replaceParams

Replace placeholders with parameters.

protected replaceParams(string $query, array $params): string

Parameters:

Parameter Type Description
$query string SQL query
$params array Query parameters

prepare

Prepares a query.

protected prepare(string $query, array $params): array

Parameters:

Parameter Type Description
$query string SQL query
$params array Query parameters

bindValues

protected bindValues(\PDOStatement $statement, array $values): void

Parameters:

Parameter Type Description
$statement \PDOStatement
$values array

pdoExecute

Executes a prepared query and returns true on success or false on failure.

protected pdoExecute(array $prepared): bool

Parameters:

Parameter Type Description
$prepared array Prepared query

supportsReturning

public supportsReturning(): bool

supportsUpsert

public supportsUpsert(): bool

supportsSavepoints

public supportsSavepoints(): bool

buildDsn

public static buildDsn(array $config): string
  • This method is static.
  • This method is abstract.

Parameters:

Parameter Type Description
$config array


Automatically generated on 2025-10-13