SQLOperations

Represents a SQL query interface to a database

package

Default

Methods

__construct

__construct() 

Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.

call( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.

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"]

Arguments

$arg0

string

$arg1

array

$arg2

array

$arg3

callable

Response

$this

Executes the given SQL <code>SELECT</code> statement which returns the results of the query.

query( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.

querySingle( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

self

Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution.

querySingleWithParams( $arg0,  $arg1,  $arg2) : $this

Only the first result from the result set is returned.

Arguments

$arg0

string

$arg1

array

$arg2

callable

Response

$this

self

Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.

queryStream( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.

queryStreamWithParams( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array

$arg2

callable

Response

$this

Executes the given SQL <code>SELECT</code> prepared statement which returns the results of the query.

queryWithParams( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array

$arg2

callable

Response

$this

Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code> statement.

update( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

Executes the given prepared statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code> statement with the given parameters

updateWithParams( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array

$arg2

callable

Response

$this