Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dd5de77
e2e version matrix update
LissaGreense May 16, 2024
5575287
Refactor that makes code shiny
LissaGreense May 16, 2024
ecb2045
Fix parser test pointer
LissaGreense May 16, 2024
c224496
Final refactor - improve select structure
LissaGreense May 22, 2024
414c56c
Fix delete command
LissaGreense May 22, 2024
2a6a1a0
Add Drop Function
ixior462 May 28, 2024
cd8e55a
Merge pull request #16 from LissaGreense/feature/drop
ixior462 May 28, 2024
78246a2
Add error handling for parser
ixior462 Jun 11, 2024
0e8cd06
second part of error handling
LissaGreense Jun 11, 2024
da92b90
Merge pull request #17 from LissaGreense/feature/error-handling
ixior462 Jun 11, 2024
2b91d01
Adds LIMIT and OFFSET keywords :D
LissaGreense Jun 11, 2024
14c009d
Add Update command
LissaGreense Jun 27, 2024
251a6f7
Merge pull request #19 from LissaGreense/feature/update-command
ixior462 Jun 27, 2024
dc6c57d
Feature/error handling tests (#20)
ixior462 Jul 11, 2024
fcb0118
Add Distinct select implementation (#21)
LissaGreense Aug 6, 2024
efa0622
Feature/joins (#22)
ixior462 Oct 8, 2024
e2e9191
Aggregate functions (#23)
LissaGreense Nov 7, 2024
3646858
Feature - "IN" and "NOTIN" condition (#24)
LissaGreense Nov 19, 2024
af34c3d
Feature/null insertion (#25)
ixior462 Dec 4, 2024
940f5fd
Add apostrophe validation errors (#26)
LissaGreense Dec 10, 2024
8d6f5a1
Add gopher to README.md (#28)
ixior462 Jan 16, 2025
2f0a67e
Refactore e2e tests (#27)
ixior462 Jan 16, 2025
87bed28
Feature - apostrophe error validate (#29)
LissaGreense Jan 16, 2025
c476fb4
Refactor and improvements (#31)
LissaGreense May 23, 2025
12a43f9
Merge branch 'main' into dev
ixior462 May 23, 2025
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
36 changes: 10 additions & 26 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Sequence struct {
Commands []Command
}

// Node is connector between commands and expressions
// Node is a connector between commands and expressions
type Node interface {
TokenLiteral() string
}
Expand Down 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