More questions ...

g40 2011-05-26 12:09:41 -07:00
parent 09448a9f46
commit 69b7fb7ffb

11
FAQ.md

@ -1,6 +1,6 @@
Thanks to [g40](https://github.com/g40)
### how do I know what values are on the row object ? ###
### 1. how do I know what values are on the row object ? ###
The row object has properties which align to the column names returned from the query.
@ -14,7 +14,7 @@ client.query('SELECT * FROM users`, function(err, result) {
});
```
### can I iterate across the columns in the recordset to dynamically display column names ? ###
### 2. can I iterate across the columns in the recordset to dynamically display column names ? ###
Why, yes. Yes you can.
```js
@ -26,4 +26,11 @@ client.query(..., function(err, result) {
});
```
### 3. Assuming a recordset is enumerated using the array accessor style used in 1, can we get the column names in the same fashion, i.e. is there a result.rows[i].columnName property? ###
### 4. (Alert! Possibly an idiot question) How do you get the count of columns in the result set ? ###
### 5. (Alert! Possibly an idiot question) If pg returns query data in JSON format, for web serivce applications, it would make sense to return that directly to the client. If this assumption is correct what is the most efficient method? ###
Thank you Brian. pg is excellent.