Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

result = await sql.unsafe(query).values() also returns columns #534

Unanswered
half-metal asked this question in Q&A
Discussion options

Hi, it appears using postgres with .values() returns more than just db rows, and the result array returned is actually larger.

I am confused that when I have result = await sql.unsafe(query).values() within my result array there is actually columns returned for example:
return json([result.columns, result]) //column names and rows //columns and rows
return json([result]) // only rows

Lets say I am selecting one record. Instead of a small array, I now have every column adding to the size

 [
 {
 "name": "id",
 "table": 25178,
 "number": 1,
 "type": 23
 }
]

Is there a way to only return rows and keep the result minimal?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /