2019-03-02 12:34:08 +01:00
|
|
|
package sqlbuilder
|
|
|
|
|
|
2019-04-29 14:39:48 +02:00
|
|
|
// A clause that can be used in orderBy by
|
2019-03-02 12:34:08 +01:00
|
|
|
|
|
|
|
|
// A clause that is selectable.
|
2019-03-31 14:07:58 +02:00
|
|
|
//type Projection interface {
|
|
|
|
|
// Clause
|
|
|
|
|
// isProjectionInterface
|
|
|
|
|
//
|
|
|
|
|
// SerializeSqlForColumnList(out *bytes.Buffer) error
|
|
|
|
|
//}
|
2019-03-30 10:17:32 +01:00
|
|
|
|
2019-03-31 14:07:58 +02:00
|
|
|
//type ColumnList []Column
|
|
|
|
|
//
|
2019-04-29 14:39:48 +02:00
|
|
|
//func (cl ColumnList) Serialize(out *bytes.Buffer, options ...serializeOption) error {
|
2019-03-31 14:07:58 +02:00
|
|
|
// for i, column := range cl {
|
2019-04-29 14:39:48 +02:00
|
|
|
// column.Serialize(out)
|
2019-03-31 14:07:58 +02:00
|
|
|
//
|
|
|
|
|
// if i != len(cl)-1 {
|
|
|
|
|
// out.WriteString(", ")
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return nil
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//func (cl ColumnList) isProjectionType() {
|
|
|
|
|
//}
|
|
|
|
|
//
|
2019-05-05 18:03:30 +02:00
|
|
|
//func (cl ColumnList) AS(name string) Clause {
|
2019-03-31 14:07:58 +02:00
|
|
|
// panic("Unallowed operation ")
|
|
|
|
|
//}
|
2019-03-15 21:25:24 +01:00
|
|
|
|
2019-03-31 14:07:58 +02:00
|
|
|
//func (cl ColumnList) SerializeSqlForColumnList(out *bytes.Buffer) error {
|
|
|
|
|
// for i, column := range cl {
|
|
|
|
|
// column.SerializeSqlForColumnList(out)
|
|
|
|
|
//
|
|
|
|
|
// if i != len(cl)-1 {
|
|
|
|
|
// out.WriteString(", ")
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return nil
|
|
|
|
|
//}
|
2019-03-15 21:25:24 +01:00
|
|
|
|
2019-03-02 12:34:08 +01:00
|
|
|
//
|
|
|
|
|
// Boiler plates ...
|
|
|
|
|
//
|
|
|
|
|
|
2019-03-31 14:07:58 +02:00
|
|
|
//
|
|
|
|
|
//type isProjectionInterface interface {
|
|
|
|
|
// isProjectionType()
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//type isProjection struct {
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//func (p *isProjection) isProjectionType() {
|
|
|
|
|
//}
|