Compare commits
	
		
			2 Commits
		
	
	
		
			5380215a56
			...
			0522b90917
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0522b90917 | |||
| 005bbe7d60 | 
							
								
								
									
										20
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								README.md
									
									
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
# query-interpreter
 | 
					# query-interpreter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**README LAST UPDATED: 04-15-25**
 | 
					**README LAST UPDATED: 04-24-25**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This project is under active development and is subject to change often and drastically as I am likely an idiot.
 | 
					    This project is under active development and is subject to change often and drastically as I am likely an idiot.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -69,13 +69,29 @@ A `Select` object is shaped as the following:
 | 
				
			|||||||
```go
 | 
					```go
 | 
				
			||||||
type Select struct {
 | 
					type Select struct {
 | 
				
			||||||
	Table        string
 | 
						Table        string
 | 
				
			||||||
	Columns      []string
 | 
						Columns      []Column
 | 
				
			||||||
	Conditionals []Conditional
 | 
						Conditionals []Conditional
 | 
				
			||||||
	OrderBys     []OrderBy
 | 
						OrderBys     []OrderBy
 | 
				
			||||||
 | 
						Joins        []Join
 | 
				
			||||||
	IsWildcard   bool
 | 
						IsWildcard   bool
 | 
				
			||||||
	IsDistinct   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
 | 
					//dependency in query.go
 | 
				
			||||||
type Conditional struct {
 | 
					type Conditional struct {
 | 
				
			||||||
	Key       string
 | 
						Key       string
 | 
				
			||||||
 | 
				
			|||||||
@ -25,7 +25,6 @@ type Conditional struct {
 | 
				
			|||||||
	Key       string
 | 
						Key       string
 | 
				
			||||||
	Operator  string
 | 
						Operator  string
 | 
				
			||||||
	Value     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
 | 
						Extension string // AND, OR, etc
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -181,9 +181,6 @@ func TestParseSelectStatement(t *testing.T) {
 | 
				
			|||||||
					if expectedCondition.Value != answer.Conditionals[i].Value {
 | 
										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)
 | 
											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 {
 | 
										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)
 | 
											t.Errorf("got %s for Select.Conditionals[%d].Extension, expected %s", answer.Conditionals[i].Extension, i, expectedCondition.Extension)
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user