Improve default value expressions

This commit is contained in:
Asdine El Hrychy
2021-07-02 18:41:33 +04:00
parent 6af0a6f114
commit fa66f81fb6
16 changed files with 381 additions and 150 deletions

View File

@@ -129,7 +129,7 @@ func Walk(e Expr, fn func(Expr) bool) bool {
}
}
return false
return true
}
type NextValueFor struct {
@@ -141,6 +141,10 @@ func (n NextValueFor) Eval(env *environment.Environment) (document.Value, error)
catalog := env.GetCatalog()
tx := env.GetTx()
if catalog == nil || tx == nil {
return NullLitteral, stringutil.Errorf(`NEXT VALUE FOR cannot be evaluated`)
}
seq, err := catalog.GetSequence(n.SeqName)
if err != nil {
return NullLitteral, err