PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
Assuming you want a few paragraphs on what you can do with the PostgreSQL API:
The following examples demonstrate some of the things that can be done with the
PostgreSQL API:
import pg from 'pg';
export default defineComponent({
props: {
postgresql: {
type: "app",
app: "postgresql",
}
},
async run({steps, $}) {
const { host, user, password, port, database, ca, cert, key } = this.postgresql.$auth;
const sslConfig = ca && cert && key ? {
ssl: {
rejectUnauthorized: true,
ca,
cert,
key,
},
} : {};
const clientConfig = {
host,
database,
user,
password,
port,
...sslConfig,
};
const client = new pg.Client(clientConfig);
await client.connect();
const results = (await client.query("SELECT NOW()")).rows;
await client.end();
return results;
},
});
export default defineComponent({
async run({ steps, $ }) {
const text = ' Hello world! ';
return text.trim()
},
})