-
-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
In this section, we'll take a closer look at how you can quickly and easily set up a configuration file to start implementing any of your tasks. You can use absolutely any format of configuration file:
- JSON
- YAML
- TOML
- HCL (Terraform)
The main condition is that your config file must contain the sections necessary for csv2api to work.
A configured config.yml file usually looks like this:
save_filtered_pk_to_csv: true
columns_order:
- id
- order_id
- is_paid
csv_separator: ','
api:
base_url: my-api-server.com
base_url_schema: https
auth_method: Bearer
token: '{{ CONFIG_API_TOKEN }}'
request_timeout: 0
update_endpoint:
endpoint_name: /api/v1/order/%s
content_type: application/json
add_pk_to_endpoint_name: true
http_method: PATCH
endpoint_body:
data:
id: id
attributes:
tags: tags
filter_columns:
- column_name: order_id
condition: NEQ
value: ''
update_fields:
- field_name: tags
values:
- paid
conditions:
- column_name: is_paid
condition: EQ
value: '1'Let's look at each section in more detail.
This section accepts true or false and allows you to specify whether to save the filtered primary keys (PK) to a CSV file.
This is useful when you need to keep track of which PK (IDs) have been filtered, to control how they change in the database or elsewhere.
Sometimes it happens, it's true… but don't get upset! 🙂
Wiki is a dynamically growing section, so write us your question, and we'll try to answer it. If the question is interesting and/or repeated too often, we'll add it to a FAQ section (with reference to the author's issue).
The best way to ask a question is to create a new issue or a discussion in GitHub repository.
So, follow this checklist to ask a question that we can answer in the shortest possible time:
- Try to search similar question in the issues section.
- If your question is about Go, or else, try to search at StackOverflow first.
- Please fully follow our template to create a new issue.
- If English is not your native language, please use an online translator in advance (for example, DeepL or Google Translate).
- Demonstrate understanding to authors, because this is Open Source and not-for-profit product, and their support is not paid.
- Be nice to the other members of our community.