mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Updated FAQ (markdown)
parent
cb56ac74de
commit
393ac8ed4e
5
FAQ.md
5
FAQ.md
@ -7,9 +7,8 @@ The row object has properties which align to the column names returned from the
|
||||
Given a table users with columns 'name' and 'age' doing `select * from users` would return you a result object with an array of row objects. Each row object would have the properties `name` and `age`. Example:
|
||||
|
||||
```js
|
||||
client.query('SELECT * FROM users', function(err, result) {
|
||||
console.log('name: %s and age: %d', result.rows[0].name, result.rows[0].age);
|
||||
});
|
||||
const result = await client.query('SELECT * FROM users');
|
||||
console.log('name: %s and age: %d', result.rows[0].name, result.rows[0].age);
|
||||
```
|
||||
|
||||
### Can I iterate across the columns in the recordset to dynamically display column names?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user