Represents a connection to a SQL database
package |
Default |
---|
__construct()
batch( $arg0, $arg1) : $this
array
callable
$this
batchCallableWithParams( $arg0, $arg1, $arg2, $arg3) : $this
The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers.
string
array
array
callable
$this
batchWithParams( $arg0, $arg1, $arg2) : $this
The operation completes with the execution of the batch where the async result contains a array of Integers.
string
array
callable
$this
call( $arg0, $arg1) : $this
string
callable
$this
callWithParams( $arg0, $arg1, $arg2, $arg3) : $this
The index of params and outputs are important for both arrays, for example when dealing with a prodecure that takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
params = [VALUE1, VALUE2, null] outputs = [null, null, "VARCHAR"]
string
array
array
callable
$this
close( $arg0 = null) : void
close()
Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
param $handler [callable] the handler called when this operation completes. close($handler)
callable
commit( $arg0) : $this
callable
$this
execute( $arg0, $arg1) : $this
string
callable
$this
getTransactionIsolation( $arg0) : $this
callable
$this
query( $arg0, $arg1) : $this
string
callable
$this
querySingle( $arg0, $arg1) : $this
string
callable
$this
self
querySingleWithParams( $arg0, $arg1, $arg2) : $this
Only the first result from the result set is returned.
string
array
callable
$this
self
queryStream( $arg0, $arg1) : $this
string
callable
$this
queryStreamWithParams( $arg0, $arg1, $arg2) : $this
string
array
callable
$this
queryWithParams( $arg0, $arg1, $arg2) : $this
string
array
callable
$this
rollback( $arg0) : $this
callable
$this
setAutoCommit( $arg0, $arg1) : $this
boolean
callable
$this
setOptions( $arg0) : $this
The options are not applied globally but applicable to the current connection. For example changing the transaction isolation level will only affect statements run on this connection and not future or current connections acquired from the connection pool.
This method is not async in nature since the apply will only happen at the moment a query is run.
array | SQLOptions
$this
setQueryTimeout( $arg0) : $this
It can be over written at any time and becomes active on the next query call.
deprecated |
---|
integer
$this
setTransactionIsolation( $arg0, $arg1) : $this
The constants defined in the interface Connection are the possible transaction isolation levels.
string
callable
$this
update( $arg0, $arg1) : $this
string
callable
$this
updateWithParams( $arg0, $arg1, $arg2) : $this
string
array
callable
$this