Add StringColumn type and expression

Add Projection type
Alias refactoring
More numeric operations
This commit is contained in:
zer0sub 2019-04-03 11:03:07 +02:00
parent 033ab1d0da
commit b2f84d048c
16 changed files with 350 additions and 199 deletions

26
sqlbuilder/projection.go Normal file
View 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
}