Skip to content

How to render a table with data from 2 databases #3100

Answered by andrewlreeve
uvinw asked this question in Questions
Discussion options

You must be logged in to vote

@uvinw if you need to use a ca-cert the below script works with the postgres resource.

import { Client } from "https://deno.land/x/[email protected]/mod.ts";
import * as wmill from "npm:windmill-client@1";

export async function main(sql:string) {
  return await pgQuery(sql);
}

export async function pgQuery(sql: string) {
  const dbConfig = await wmill.getResource("<RESOURCE_FOLDER>");

  const clientOptions = {
    hostname: dbConfig.host,
    port: dbConfig.port,
    user: dbConfig.user,
    database: dbConfig.dbname,
    password: dbConfig.password,
    host_type: "tcp",
    tls: {
      enabled: true,
      enforce: true,
      caCertificates: [dbConfig.root_certificate_pem],
    },
  };

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@uvinw
Comment options

Answer selected by uvinw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants