Skip to content

Use of ColumnSet for setting up "SELECT" or "RETURNING" clauses #870

Answered by vitaly-t
sebastorama asked this question in Q&A
Discussion options

You must be logged in to vote

ColumnSet is intended for the functions provided within the helpers namespace. "Select" isn't there, and not meant to be.

If you want to reuse ColumnSet in that manner, you can create a function that will generate such syntax:

function listColumns(cs : ColumnSet) : string {
    return cs.columns.map(c => c.escapedName + (c.cast ? '::' + c.cast : '')).join(', ');
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@sebastorama
Comment options

Answer selected by sebastorama
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants