Interface QueryInterface

Summary

Fully Qualified Name: CodeIgniter\Database\QueryInterface

Description

Interface QueryInterface

Represents a single statement that can be executed against the database. Statements are platform-specific and can handle binding of binds.

Methods

Name Description Defined By
getDuration() Returns the duration of this query during execution, or null if the query has not been executed yet. QueryInterface
getErrorCode() Returns the error code created while executing this statement. QueryInterface
getErrorMessage() Returns the error message created while executing this statement. QueryInterface
getQuery() Returns the final, processed query string after binding, etal has been performed. QueryInterface
hasError() Reports whether this statement created an error not. QueryInterface
isWriteType() Determines if the statement is a write-type query or not. QueryInterface
setDuration() Records the execution time of the statement using microtime(true) for it's start and end values. If no end value is present, will use the current time to determine total duration. QueryInterface
setError() Stores the error description that happened for this query. QueryInterface
setQuery() Sets the raw query string to use for this statement. QueryInterface
swapPrefix() Swaps out one table prefix for a new one. QueryInterface

Method Details

getDuration()

Returns the duration of this query during execution, or null if the query has not been executed yet.

Parameter Name Type Description
$decimals int The

Returns: string

getErrorCode()

Returns the error code created while executing this statement.

Returns: int

getErrorMessage()

Returns the error message created while executing this statement.

Returns: string

getQuery()

Returns the final, processed query string after binding, etal has been performed.

Returns: mixed

hasError()

Reports whether this statement created an error not.

Returns: bool

isWriteType()

Determines if the statement is a write-type query or not.

Returns: bool

setDuration()

Records the execution time of the statement using microtime(true) for it's start and end values. If no end value is present, will use the current time to determine total duration.

Parameter Name Type Description
$start float
$end float

Returns: mixed

setError()

Stores the error description that happened for this query.

Parameter Name Type Description
$code int
$error string

Returns:

setQuery()

Sets the raw query string to use for this statement.

Parameter Name Type Description
$sql string
$binds mixed
$setEscape bool

Returns: mixed

swapPrefix()

Swaps out one table prefix for a new one.

Parameter Name Type Description
$orig string
$swap string

Returns: mixed

Top