Uibuilder with PostgreSQL connection

Dear sir, madam,

Is there a way to connect the uibuilder with the PostgreSQL database to call/ gather data, something similar to the code below here, without using the local flow connection (connecting the lines together)?

const { Client } = require('pg')
const client = new Client({
  user: 'sgpostgres',
  host: 'SG-PostgreNoSSL-14-pgsql-master.devservers.scalegrid.io',
  database: 'postgres',
  password: 'password',
  port: 5432,
client.connect(function(err) {
  if (err) throw err;

That is not advisable. your credentials would be discoverable in the client side code.

You should either generate an API (add node-red endpoints) and call them from your pages OR use the built in mechanisms uibuilder gives you for passing data to/from node-red

1 Like

alright, I see, thank you for your response/ answer.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.