class QueryException extends PDOException (View source)

Properties

string $connectionName

The database connection name.

protected string $sql

The SQL for the query.

protected array $bindings

The bindings for the query.

protected array $connectionDetails

The connection details for the query (host, port, database, etc.).

Methods

__construct(string $connectionName, string $sql, array $bindings, Throwable $previous, array $connectionDetails = [])

Create a new query exception instance.

string
formatMessage(string $connectionName, string $sql, array $bindings, Throwable $previous)

Format the SQL error message.

string
formatConnectionDetails()

Format the connection details for the error message.

string
getConnectionName()

Get the connection name for the query.

string
getSql()

Get the SQL for the query.

string
getRawSql()

Get the raw SQL representation of the query with embedded bindings.

array
getBindings()

Get the bindings for the query.

array
getConnectionDetails()

Get information about the connection such as host, port, database, etc.

Details

__construct(string $connectionName, string $sql, array $bindings, Throwable $previous, array $connectionDetails = [])

Create a new query exception instance.

Parameters

string $connectionName
string $sql
array $bindings
Throwable $previous
array $connectionDetails

protected string formatMessage(string $connectionName, string $sql, array $bindings, Throwable $previous)

Format the SQL error message.

Parameters

string $connectionName
string $sql
array $bindings
Throwable $previous

Return Value

string

protected string formatConnectionDetails()

Format the connection details for the error message.

Return Value

string

string getConnectionName()

Get the connection name for the query.

Return Value

string

string getSql()

Get the SQL for the query.

Return Value

string

string getRawSql()

Get the raw SQL representation of the query with embedded bindings.

Return Value

string

array getBindings()

Get the bindings for the query.

Return Value

array

array getConnectionDetails()

Get information about the connection such as host, port, database, etc.

Return Value

array