You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/session/query.go

21 lines
423 B

package session
const (
activateStateCte = `
insert into session_state
with not_active as (
select session_id, 'active' as state
from
session s,
session_state ss
where
s.public_id = ss.session_id and
ss.state = 'pending' and
ss.session_id = $1 and
s.version = $2 and
s.public_id not in(select session_id from session_state where session_id = $1 and state = 'active')
)
select * from not_active;
`
)