import React from 'react'; const knex = require('knex'); // we require this pakages to use this - knex , oracledb , pg , pg-query-stream // we tried with prisma but got stucked in fetching data function page() { const db = async () => { const database = knex({ client: 'pg', connection: { host: '1.2.3.4', port: 5432, user: 'username', password: 'password', database: 'databasename' } }); const a = await database.from('analytics.u_kpi_essentialdata').select(); console.log('test---', a); }; db(); return ( <div> <div>page</div> <div> naks</div> </div> ); } export default page;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter