Skip to content

User sequence generators in helpers #879

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

You must be logged in to vote

Your id column should be:

{
    name: 'id',
    mod: ':raw',
    init: () => pgp.as.format('nextVal($1)', ['sequence_border'])
}

Or even simpler, if the column text is static:

{
    name: 'id',
    mod: ':raw',
    init: () => 'nextVal(\'sequence_border\')'
}

See Column class.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@if-mar
Comment options

Answer selected by if-mar
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