Add StringColumn type and expression
Add Projection type Alias refactoring More numeric operations
This commit is contained in:
parent
033ab1d0da
commit
b2f84d048c
16 changed files with 350 additions and 199 deletions
26
sqlbuilder/projection.go
Normal file
26
sqlbuilder/projection.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package sqlbuilder
|
||||
|
||||
import "bytes"
|
||||
|
||||
type Projection interface {
|
||||
SerializeForProjection(out *bytes.Buffer) error
|
||||
}
|
||||
|
||||
//------------------------------------------------------//
|
||||
// Dummy type for select * AllColumns
|
||||
type ColumnList []Column
|
||||
|
||||
func (cl ColumnList) SerializeForProjection(out *bytes.Buffer) error {
|
||||
for i, column := range cl {
|
||||
err := column.SerializeSql(out, FOR_PROJECTION)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if i != len(cl)-1 {
|
||||
out.WriteString(", ")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue