mirror of
https://github.com/chaisql/chai.git
synced 2025-10-06 08:06:55 +08:00
Improve default value expressions
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user