Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 845 Bytes

Query.md

File metadata and controls

42 lines (28 loc) · 845 Bytes

Query

Extracts data from a database table using a custom SQL query.

/** @var \Wizaplace\Etl\Extractors\Query $query */
$etl->extract($query, 'select * from users', $options);

Options

Connection

Name of the database connection to use.

Type Default value
string default
$options = [Query::CONNECTION => 'app'];

Bindings

Values to bind to the query statement.

Type Default value
array []

Using prepared statement with named placeholders select * from users where status = :status:

$options = [Query::BINDINGS => ['status' => 'active']];

Using prepared statement with question mark placeholders select * from users where status = ?:

$options = [Query::BINDINGS => ['active']];