Skip to content

Commit

Permalink
add boolean type (eatonphil#4)
Browse files Browse the repository at this point in the history
Co-authored-by: Parker Duckworth <[email protected]>
  • Loading branch information
parkerduckworth and Parker Duckworth authored Apr 13, 2020
1 parent 9f38d07 commit 0d2a5fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
valuesKeyword keyword = "values"
intKeyword keyword = "int"
textKeyword keyword = "text"
boolKeyword keyword = "boolean"
whereKeyword keyword = "where"
andKeyword keyword = "and"
orKeyword keyword = "or"
Expand Down Expand Up @@ -182,6 +183,7 @@ func lexKeyword(source string, ic cursor) (*token, cursor, bool) {
fromKeyword,
intoKeyword,
textKeyword,
boolKeyword,
intKeyword,
andKeyword,
orKeyword,
Expand Down
2 changes: 2 additions & 0 deletions memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ func (mb *MemoryBackend) CreateTable(crt *CreateTableStatement) error {
dt = IntType
case "text":
dt = TextType
case "boolean":
dt = BoolType
default:
return ErrInvalidDatatype
}
Expand Down

0 comments on commit 0d2a5fa

Please sign in to comment.