# Storage Nodes

# Node: PostgreSQL

PostgreSQL node is Kumologica node allowing basic access to PostgreSQL database. PostgreSQL sets up a console to execute queries against the configured database.

# Properties

  • Host - The hostname of PostgreSQL database server.
  • Port - The port number server is listening on, default 5432.
  • Database - The name of the database
  • Idle Timeout - The time in milliseconds the node needs to keep connection idle.
  • SSL - Indicator if ssl to be enabled to connect to PostgreSQL database.
  • Username - The user name to connect to PostgreSQL database.
  • Password - The user's password to connect to PostgreSQL database.
  • Command - The SQL command to be executed.

# Response

The msg.payload will contain the result object of the query. It has the following properties:

  • command - The sql command that was executed (e.g. "SELECT", "UPDATE", etc.)
  • rowCount - The number of rows affected by the SQL statement
  • oid - The oid returned
  • rows - An array of rows

PostgreSQL node implements a template engine allowing parameterized queries.

/* INTEGER id COLUMN */
  SELECT *
    FROM table
   WHERE id = [[ msg.id ]]
  
  /* VARCHAR id COLUMN*/
  SELECT *
    FROM table
   WHERE id = '[[ msg.id ]]'