We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 443ab41 commit c38d311Copy full SHA for c38d311
src/index.js
@@ -0,0 +1,20 @@
1
+const dotenv = require('dotenv').config()
2
+
3
+if(dotenv.error) throw dotenv.error
4
5
+const c = con => console.log(con)
6
7
+const pool = require('./database')
8
9
+// Obtiene usuarios de BBDD para datos del archivo
10
+const getUsers = async () => {
11
+ c('Consultando datos...')
12
+ const { rows } = await pool.query('SELECT * FROM auth.users')
13
+ c(`Consulta exitosa con ${rows.length} filas`)
14
+ pool.end()
15
+ return rows
16
+}
17
18
+(async () => {
19
+ const users = await getUsers()
20
+})()
0 commit comments