Menu

## Pgsql extends DriverBase
in package

Pgsql.php : 15

Represents the PostgreSQL driver for the PDO database class.

### Table of Contents

#### Properties

$driver : string
$dsnParams : array<string, string>
$password : string
$pdo : PDO|null
$username : string

#### Methods

connect() : Pgsql
  Connects to the PostgreSQL database using the provided parameters.
disconnect() : void
  Disconnects from the database.
driverSupportsLastInsertId() : bool
  Checks if the PostgreSQL driver supports the last insert ID retrieval.
getDeleteSql() : string
  Generates a DELETE SQL statement for the specified table and WHERE clause.
getDriver() : string
  Returns the driver name for the connection.
getDriverColumnName() : string
  Returns the name of the driver column.
getGetColumnsSql() : string
  Returns the SQL query to retrieve the columns of a table.
getGetTablesSql() : string
  Returns the SQL query to retrieve the list of tables in the database.
getLimitSql() : string
  Returns the SQL query string for applying a limit to the result set in PostgreSQL.
getPdo() : PDO
  Returns the PDO object representing the database connection.

### Properties

#### $driver

Pgsql.php : 19
`protected string $driver = 'pgsql'`

#### $dsnParams

DriverBase.php : 21
`protected array<string, string> $dsnParams = []`

The array to store the connection details.

#### $password

DriverBase.php : 25
`protected string $password`

#### $pdo

Pgsql.php : 17
`protected PDO|null $pdo = null`

#### $username

DriverBase.php : 23
`protected string $username`

### Methods

#### connect()

Pgsql.php : 29

Connects to the PostgreSQL database using the provided parameters.

`public connect(array<string, string> $dsnParams, string $username, string $password) : Pgsql`

##### Parameters

$dsnParams : array<string, string>

  The parameters for the DSN connection string.

$username : string

  The username for the database connection.

$password : string

  The password for the database connection.

##### Return values

Pgsql —

The Pgsql object representing the database driver.

#### disconnect()

DriverBase.php : 40

Disconnects from the database.

`public disconnect() : void`

#### driverSupportsLastInsertId()

Pgsql.php : 78

Checks if the PostgreSQL driver supports the last insert ID retrieval.

`public driverSupportsLastInsertId() : bool`

##### Return values

bool —

Returns true if the driver supports last insert ID retrieval, false otherwise.

#### getDeleteSql()

Pgsql.php : 105

Generates a DELETE SQL statement for the specified table and WHERE clause.

`public getDeleteSql(string $table, string $where) : string`

##### Parameters

$table : string

  The name of the table to delete from.

$where : string

  The WHERE clause to filter the rows to be deleted.

##### Return values

string —

The generated DELETE SQL statement.

#### getDriver()

DriverBase.php : 50

Returns the driver name for the connection.

`public getDriver() : string`

##### Return values

string —

The driver name.

#### getDriverColumnName()

Pgsql.php : 121

Returns the name of the driver column.

`public getDriverColumnName() : string`

##### Return values

string —

The name of the driver column.

#### getGetColumnsSql()

Pgsql.php : 89

Returns the SQL query to retrieve the columns of a table.

`public getGetColumnsSql(string $table) : string`

##### Parameters

$table : string

  The name of the table.

##### Return values

string —

The SQL query to retrieve the columns of the table.

#### getGetTablesSql()

Pgsql.php : 126

Returns the SQL query to retrieve the list of tables in the database.

`public getGetTablesSql() : string`

##### Return values

string —

The SQL query.

#### getLimitSql()

Pgsql.php : 137

Returns the SQL query string for applying a limit to the result set in PostgreSQL.

`public getLimitSql(string $limit) : string`

##### Parameters

$limit : string

  The limit value to be applied to the query.

##### Return values

string —

The SQL query string with the limit applied.

#### getPdo()

DriverBase.php : 60

Returns the PDO object representing the database connection.

`public getPdo() : PDO`

##### Return values

PDO —

The PDO object representing the database connection.

## Search results