Skip to content

Commit

Permalink
Merge pull request #4 from keboola/webrouse-COM-471-full-load
Browse files Browse the repository at this point in the history
Full load support
  • Loading branch information
michaljurecko authored Oct 30, 2020
2 parents 8ac7014 + 45643fa commit d640773
Show file tree
Hide file tree
Showing 161 changed files with 3,390 additions and 322 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": [
"@keboola/node"
],
"plugins": [
"import"
],
"env": {
"node": true
},
"rules": {
"no-console": "off",
"no-constant-condition": "off",
"no-await-in-loop": "off"
}
}
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,36 @@ The configuration `config.json` contains following properties in `parameters` ke
- `endpoint` - string (required): Cosmos DB [SQL API](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-getting-started) endpoint.
- `#key` - string (required): Access key.
- `databaseId` - string (required): Database ID.
- `id` - integer (required): `id` of the config row.
- `name` - string (required): Name of the config row.
- `id` - integer (optional): Id of the config row.
- `name` - string (optional): Name of the config row.
- `containerId` - string (required): Container is similar to table in the relational db, or collection in the MongoDB.
- `output` - string (required): Name of the output CSV file.
- `retries`- integer (optional): Number of the max retries if an error occurred.
- `ignoredKeys`- array (optional):
- CosmosDB automatically adds some metadata keys when the item is inserted.
- By default, these keys are ignored: `["_rid", "_self", "_etag", "_attachments", "_ts"]`
- `incremental` - boolean (optional): Enables [Incremental Loading](https://help.keboola.com/storage/tables/#incremental-loading). Default `false`.
- `incrementalFetchingKey` - string (optional): Name of key for [Incremental Fetching](https://help.keboola.com/components/extractors/database/#incremental-fetching)
- `mode` - enum (optional)
- `mapping` (default) - Documents are exported using specified `mapping`, [read more](https://github.com/keboola/php-csvmap).
- `raw` - Documents are exported as plain JSON strings.
- `raw` - Documents are exported as plain JSON strings. CSV file will contain `id` and `data` columns.
- `mapping` - string - required for `mode` = `mapping`, [read more](https://github.com/keboola/php-csvmap).



- By default, Extractor exports all documents, using **the generated SQL query**.
- By default, Extractor exports all documents, using **the generated SQL query**.
- Default query is `SELECT * FROM c`
- Query can be modified with these parameters:
- `select` - string (optional), eg. `name, date`
- `sort` - string (optional), eg. `date`
- `limit` - integer (optional), eg. 500
- `select` - string (optional), eg. `c.name, c.date`, default `*`, [read more](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-select).
- For `raw` mode must be `id` field present in the query results.
- `from` - string (optional), eg. `Families f`, default `c`, [read more](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-from).
- `sort` - string (optional), eg. `c.date`, [read more](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-order-by).
- `limit` - integer (optional), eg. `500`, [read more](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-offset-limit).



- Or you can set **a custom query** using parameter:
- `query` - string (optional), eg. `SELECT * FROM c`
- `query` - string (optional), eg. `SELECT f.name FROM Families f`


## Actions
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"ext-json": "*",
"ext-pcntl": "*",
"halaxa/json-machine": "^0.3.3",
"keboola/csv": "^2.2",
"keboola/csvmap": "^1.1",
"keboola/php-component": "^8.1",
"react/child-process": "^0.6.1",
"react/event-loop": "^1.1",
Expand Down Expand Up @@ -45,10 +47,13 @@
"phpcs": "phpcs -n --ignore=vendor --extensions=php .",
"phpcbf": "phpcbf -n --ignore=vendor --extensions=php .",
"phplint": "parallel-lint -j 10 --exclude vendor .",
"eslint": "./node_modules/.bin/eslint --color src",
"eslint-fix": "./node_modules/.bin/eslint --fix --color src",
"build": [
"@phplint",
"@phpcs",
"@phpstan",
"@eslint",
"@tests"
],
"ci": [
Expand Down
Loading

0 comments on commit d640773

Please sign in to comment.