Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/end2end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.21.13', '1.22.7', '1.23.1' ]
go: [ '1.23.6', '1.24.0' ]
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.21.13', '1.22.7', '1.23.1' ]
go: [ '1.23.6', '1.24.0' ]
steps:
- uses: actions/checkout@v3

Expand Down
34 changes: 9 additions & 25 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ type Tifier interface {
func (p *Sequence) TokenLiteral() string {
if len(p.Commands) > 0 {
return p.Commands[0].TokenLiteral()
} else {
return ""
}
return ""
}

// Identifier - Represent Token with string value that is equal to either column or table name
Expand All @@ -62,7 +61,7 @@ type Identifier struct {
func (ls Identifier) IsIdentifier() bool { return true }
func (ls Identifier) GetToken() token.Token { return ls.Token }

// Anonymitifier - Represent Token with string value that is equal to simple value that is put into columns
// Anonymitifier - Represent Token with a string value that is equal to a simple value that is put into columns
type Anonymitifier struct {
Token token.Token // the token.IDENT token
}
Expand Down Expand Up @@ -107,7 +106,7 @@ func (ls ConditionExpression) GetIdentifiers() []Identifier {
return identifiers
}

// ContainExpression - TokenType of Expression that represents structure for IN operator
// ContainExpression - TokenType of Expression that represents structure for-IN-operator
//
// Example:
// colName IN ('value1', 'value2', 'value3')
Expand Down Expand Up @@ -205,7 +204,7 @@ type SelectCommand struct {

func (ls SelectCommand) CommandNode() {}
func (ls SelectCommand) TokenLiteral() string { return ls.Token.Literal }
func (ls *SelectCommand) AggregateFunctionAppears() bool {
func (ls SelectCommand) AggregateFunctionAppears() bool {
for _, space := range ls.Space {
if space.ContainsAggregateFunc() {
return true
Expand All @@ -223,10 +222,7 @@ func (ls *SelectCommand) AggregateFunctionAppears() bool {
// SELECT * FROM table;
// Returns false
func (ls SelectCommand) HasWhereCommand() bool {
if ls.WhereCommand == nil {
return false
}
return true
return ls.WhereCommand != nil
}

// HasOrderByCommand - returns true if optional OrderByCommand is present in SelectCommand
Expand All @@ -238,10 +234,7 @@ func (ls SelectCommand) HasWhereCommand() bool {
// SELECT * FROM table;
// Returns false
func (ls SelectCommand) HasOrderByCommand() bool {
if ls.OrderByCommand == nil {
return false
}
return true
return ls.OrderByCommand != nil
}

// HasLimitCommand - returns true if optional LimitCommand is present in SelectCommand
Expand All @@ -253,10 +246,7 @@ func (ls SelectCommand) HasOrderByCommand() bool {
// SELECT * FROM table;
// Returns false
func (ls SelectCommand) HasLimitCommand() bool {
if ls.LimitCommand == nil {
return false
}
return true
return ls.LimitCommand != nil
}

// HasOffsetCommand - returns true if optional OffsetCommand is present in SelectCommand
Expand All @@ -268,10 +258,7 @@ func (ls SelectCommand) HasLimitCommand() bool {
// SELECT * FROM table LIMIT 10;
// Returns false
func (ls SelectCommand) HasOffsetCommand() bool {
if ls.OffsetCommand == nil {
return false
}
return true
return ls.OffsetCommand != nil
}

// HasJoinCommand - returns true if optional JoinCommand is present in SelectCommand
Expand All @@ -283,10 +270,7 @@ func (ls SelectCommand) HasOffsetCommand() bool {
// SELECT * FROM table;
// Returns false
func (ls SelectCommand) HasJoinCommand() bool {
if ls.JoinCommand == nil {
return false
}
return true
return ls.JoinCommand != nil
}

// UpdateCommand - Part of Command that allow to change existing data
Expand Down
Empty file modified e2e/e2e_test.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion engine/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/LissaGreense/GO4SQL/token"
)

// Column - part of the Table containing name of Column and values in it
// Column - part of the Table containing the name of Column and values in it
type Column struct {
Name string
Type token.Token
Expand Down
Loading