\Gishiki\Database\Adapters\Utils\SQLGeneratorSQLWrapperInterface

Represents how a SQL query wrapper must be implemented when designing a new database connector.

Summary

Methods
Constants
__construct()
update()
set()
createTable()
dropTable()
where()
insertInto()
values()
limitOffsetOrderBy()
selectAllFrom()
deleteFrom()
definedAs()
exportQuery()
exportParams()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

__construct()

__construct() 

Initialize an empty SQL query.

set()

set(array  $values) : \Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

Add SET col1 = ?, col2 = ?, col3 = ? to the SQL query.

Parameters

array $values

an associative array of columns => value to be changed

Returns

\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

the updated sql builder

createTable()

createTable(string  $tableName) : \Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

Add CREATE TABLE IF NOT EXISTS %tablename% to the SQL query.

Parameters

string $tableName

the name of the table

Returns

\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

the updated sql builder

values()

values(array  $values) : \Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

Add (col1, col2, col3) VALUES (?, ?, ?, ?) to the SQL query.

Parameters

array $values

an associative array of columnName => rowValue

Returns

\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

the updated sql builder

selectAllFrom()

selectAllFrom(string  $table) : \Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

Add SELECT * FROM %tablename% to the SQL query.

Parameters

string $table

the name of the table to be affected

Returns

\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

the updated sql builder

definedAs()

definedAs(array  $columns) : \Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

Add (id INTEGER PRIMARY KEY NUT NULL, name TEXT NOT NULL, .

.. ) to the SQL query.

Parameters

array $columns

a collection of Gishiki\Database\Schema\Column

Returns

\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface

the updated sql builder

exportQuery()

exportQuery() : string

Export the SQL query string with ? in place of actual parameters.

Returns

string —

the SQL query without values

exportParams()

exportParams() : array

Export the list of parameters that will replace ? in the SQL query.

Returns

array —

the list of params