PostgreSQL create table

Introduction

The /postgres/create_table flow is designed to create tables in PostgreSQL instance of sandbox based on incomming data. Structure of tables is predefined and it aligns with other examples. You can generate new SQL queries to modify structure of tables

Flow Overview

[IMAGE OF FLOW]

This documentation outlines the key components and functionalities within the Postgres Create Table, focusing on:

  1. Receiving POST request containing data.

  2. Setting dynamic queries in function node for database operations.

Post Request Handling

Purpose

Initiates the flow by receiving data through a POST request to a specified address. This example shows you how to specify endpoint where data is going to be sent and example configuration/structure of data.

Configuration

Following json file only represents example structure of POST request. Json file contains fields for PostgreSQL username and password. Username and password in example are random and you should select them based on your roles name. Username will be used in dynamic table name generation.

You should also modify url and host and set them to your device.

Example of Post request to send:

{
  "info": {
    "_postman_id": "56ff6dea-0cd1-40b3-80ef-8a7426935ede",
    "name": "IoTool",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "4611963"
  },
  "item": [
    {
      "name": "postgres_create_table",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "un",
              "value": "username",
              "type": "text"
            },
            {
              "key": "up",
              "value": "password",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "http://dev.sandbox.engineering:1880/postgres_create_table",
          "protocol": "http",
          "host": [
            "test.sandbox.engineering"
          ],
          "port": "1880",
          "path": [
            "android",
            "postgres_create_table"
          ]
        }
      },
      "response": []
    }
  ]
}