How to use the pg-promise.as.ctf function in pg-promise

To help you get started, we’ve selected a few pg-promise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dstack-group / Butterfly / user-manager / user-manager-rest-api / src / utils / getSQLFile.ts View on Github external
schema, // replaces ${schema~} with the value of the `schema` argument
    },
  };

  const queryFile: QueryFile = new QueryFile(fullPath, options);

  if (queryFile.error) {
    // Something is wrong with our query file :(
    // Testing all files through queries can be cumbersome,
    // so we also report it here, while loading the module:
    // tslint:disable-next-line:no-console
    console.error(queryFile.error);
  }

  // @ts-ignore
  return queryFile[as.ctf.toPostgres]();
}