diff --git a/db/define_test.go b/db/define_test.go index 447355f4..bc50d57d 100644 --- a/db/define_test.go +++ b/db/define_test.go @@ -62,7 +62,7 @@ func TestDefine(t *testing.T) { txt := ` USE NS test DB test; - DEFINE SCOPE test SESSION 1h + DEFINE SCOPE test SESSION 1h0m0s SIGNUP AS ( IF $ip IN ["127.0.0.1", "213.172.165.134"] THEN (CREATE user SET email=$user, pass=bcrypt.generate($pass)) diff --git a/sql/scanner.go b/sql/scanner.go index 83827591..4474b6e6 100644 --- a/sql/scanner.go +++ b/sql/scanner.go @@ -748,7 +748,7 @@ func (s *scanner) scanNumber(chp ...rune) (tok Token, lit string, val interface{ } else if isNumber(ch) { buf.WriteRune(ch) } else if isLetter(ch) { - if tok == NUMBER || tok == DOUBLE { + if tok == NUMBER || tok == DOUBLE || tok == DURATION { tok = IDENT buf.WriteRune(ch) switch ch {