Skip to content

Commit

Permalink
Add query extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
leomarquine committed Sep 13, 2018
1 parent d56153f commit eee8c52
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/Extractors/Query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Query Extractor

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

## Options

| Name | Type | Default | Description |
| ---- |----- | ------- | ----------- |
| connection | string | default | Name of the database connection to use. |
| bindings | array | `[]` | Values to bind to the query statement. |


## Usage

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

Custom options:
```php
$options = [
'connection' => 'app',
'bindings' => ['active'],
];

$etl->extract('query', 'select * from users where status = ?', $options);
```
1 change: 1 addition & 0 deletions docs/Extractors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* [CSV](Csv.md)
* [Fixed Width](FixedWidth.md)
* [JSON](Json.md)
* [Query](Query.md)
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
* [CSV](Extractors/Csv.md)
* [Fixed Width](Extractors/FixedWidth.md)
* [JSON](Extractors/Json.md)
* [Query](Extractors/Query.md)

0 comments on commit eee8c52

Please sign in to comment.