2019-04-03 11:03:07 +02:00
|
|
|
package sqlbuilder
|
|
|
|
|
|
2019-05-07 19:06:21 +02:00
|
|
|
type projection interface {
|
2019-05-08 13:47:01 +02:00
|
|
|
serializeForProjection(statement statementType, out *queryData) error
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------//
|
|
|
|
|
// Dummy type for select * AllColumns
|
2019-06-05 17:15:20 +02:00
|
|
|
type ColumnList []Column
|
2019-04-03 11:03:07 +02:00
|
|
|
|
2019-05-07 19:06:21 +02:00
|
|
|
func (cl ColumnList) isProjectionType() {}
|
|
|
|
|
|
2019-05-08 13:47:01 +02:00
|
|
|
func (cl ColumnList) serializeForProjection(statement statementType, out *queryData) error {
|
2019-06-09 11:06:08 +02:00
|
|
|
projections := columnListToProjectionList(cl)
|
2019-04-03 11:03:07 +02:00
|
|
|
|
2019-06-09 11:06:08 +02:00
|
|
|
err := serializeProjectionList(statement, projections, out)
|
2019-04-03 11:03:07 +02:00
|
|
|
|
2019-06-09 11:06:08 +02:00
|
|
|
if err != nil {
|
|
|
|
|
return err
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|
2019-05-03 12:51:57 +02:00
|
|
|
|
2019-06-09 11:06:08 +02:00
|
|
|
return nil
|
2019-05-03 12:51:57 +02:00
|
|
|
}
|