Seamless database integration with native drivers for every framework. Get up and running with your data layer in no time.
1import { Pool } from 'pg';2 3const pool = new Pool({4 host: 'localhost',5 port: 5432,6 database: 'mydb',7 user: 'user',8 password: 'password'9});10 11(async function() {12 try {13 const client = await pool.connect();14 const result = await client.query('SELECT NOW()');15 console.log('Connected:', result.rows[0]);16 client.release();17 } catch (error) {18 console.error('Connection error:', error);19 }20})();