is_current

This commit is contained in:
Ryan McKinley 2024-06-12 02:44:49 +03:00
parent df148ca9ea
commit d83aa7f865

View File

@ -25,13 +25,10 @@ FROM "resource"
name), so we're guaranteed to have at most one matching row. name), so we're guaranteed to have at most one matching row.
*/}} */}}
{{ if gt .ResourceVersion 0 }} {{ if gt .ResourceVersion 0 }}
AND {{ .Ident "rv" }} <= {{ .Arg .ResourceVersion }} AND {{ .Ident "rv" }} <= {{ .Arg .ResourceVersion }}
ORDER BY {{ .Ident "rv" }} DESC ORDER BY {{ .Ident "rv" }} DESC
LIMIT 1 LIMIT 1
{{ else }}
AND {{ .Ident "is_current" }} = true
{{ end }} {{ end }}
;
{{ if .SelectForUpdate }}
{{ .SelectFor "UPDATE NOWAIT" }}
{{ end }}
;