Compare commits

..

No commits in common. "0522b909177e4ebd963a42f4915653b9e18a352b" and "5380215a561c05fa98aa07b170ad90c49ce8fd0a" have entirely different histories.

3 changed files with 6 additions and 18 deletions

View File

@ -1,6 +1,6 @@
# query-interpreter
**README LAST UPDATED: 04-24-25**
**README LAST UPDATED: 04-15-25**
This project is under active development and is subject to change often and drastically as I am likely an idiot.
@ -69,29 +69,13 @@ A `Select` object is shaped as the following:
```go
type Select struct {
Table string
Columns []Column
Columns []string
Conditionals []Conditional
OrderBys []OrderBy
Joins []Join
IsWildcard bool
IsDistinct bool
}
type Column struct {
Name string
Alias string
AggregateFunction AggregateFunctionType
}
type AggregateFunctionType int
const (
MIN AggregateFunctionType = iota + 1
MAX
COUNT
SUM
AVG
)
//dependency in query.go
type Conditional struct {
Key string

View File

@ -25,6 +25,7 @@ type Conditional struct {
Key string
Operator string
Value string
DataType string // TODO: not something we can parse from string, but find a way to determine this later
Extension string // AND, OR, etc
}

View File

@ -181,6 +181,9 @@ func TestParseSelectStatement(t *testing.T) {
if expectedCondition.Value != answer.Conditionals[i].Value {
t.Errorf("got %s for Select.Conditionals[%d].Value, expected %s", answer.Conditionals[i].Value, i, expectedCondition.Value)
}
if expectedCondition.DataType != answer.Conditionals[i].DataType {
t.Errorf("got %s for Select.Conditionals[%d].DataType, expected %s", answer.Conditionals[i].DataType, i, expectedCondition.DataType)
}
if expectedCondition.Extension != answer.Conditionals[i].Extension {
t.Errorf("got %s for Select.Conditionals[%d].Extension, expected %s", answer.Conditionals[i].Extension, i, expectedCondition.Extension)
}