Insert

Inserts data into a database table.

$etl->load('insert', 'table_name', $options);

Options

Columns

Columns that will be loaded. If null, all columns in the process will be inserted.

To select which columns will be loaded, use an array with the columns list:

$options = ['columns' => ['id', 'name', 'email']];

To map columns from the etl process to the database table, use an associative array where the key is the name of the process column and the value is the table column:

$options = ['columns' => [
    'id' => 'user_id',
    'name' => 'full_name',
]];

Connection

Name of the database connection to use.

$options = ['connection' => 'app'];

Timestamps

Populates the created_at column with the current timestamp when inserting a row.

$options = ['timestamps' => true];

Transaction

Indicates if the loader will perform database transactions.

$options = ['transaction' => false];

Commit Size

Transaction commit size. The transaction option must be enabled.

$options = ['commit_size' => 500];

Last updated