PHP ETL
  • Introduction
  • Getting Started
  • Extractors
    • Collection
    • CSV
    • Fixed Width
    • JSON
    • Query
    • Table
    • XML
  • Transformers
    • Convert Case
    • JSON Decode
    • JSON Encode
    • Rename Columns
    • Trim
    • Unique Rows
  • Loaders
    • Insert
    • Insert/Update
  • Helpers
  • Running Processes
Powered by GitBook
On this page
  • Options
  • Connection
  • Bindings
  1. Extractors

Query

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

$etl->extract('query', 'select * from users', $options);

Options

Connection

Name of the database connection to use.

Type

Default value

string

default

$options = ['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 = ['bindings' => ['status' => 'active']];

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

$options = ['bindings' => ['active']];
PreviousJSONNextTable

Last updated 6 years ago