Skip to content

Querytoinsert

flowtask.components.QueryToInsert

QueryToInsert

QueryToInsert(loop=None, job=None, stat=None, **kwargs)

Bases: FlowComponent

QueryToInsert.

Overview

This component allows me to insert data into a database schema

.. table:: Properties :widths: auto

+--------------+----------+-----------+-------------------------------------------------------+ | Name | Required | Summary | +--------------+----------+-----------+-------------------------------------------------------+ | schema | Yes | Name of the schema where is to the table | +--------------+----------+-----------+-------------------------------------------------------+ | tablename | Yes | Name of the table in the database | +--------------+----------+-----------+-------------------------------------------------------+ | action | Yes | Sets the action to execute in this case an insert | +--------------+----------+-----------+-------------------------------------------------------+ | pk | Yes | Primary key to the table in the database | +--------------+----------+-----------+-------------------------------------------------------+ | directory | Yes | Source directory where the file is located | +--------------+----------+-----------+-------------------------------------------------------+ | filter | Yes | This attribute allows me to apply a filter to the data | +--------------+----------+-----------+-------------------------------------------------------+

Return the list of arbitrary days

Example:

```yaml
QueryToInsert:
  schema: public
  tablename: queries
  action: insert
  pk:
  - query_slug
  directory: /home/ubuntu/symbits/
  filter:
    query_slug: walmart_stores
```

close

close()

Method.

run async

run()

Async Method.

start async

start(**kwargs)

Start.