Additional documentation.
This commit is contained in:
parent
d253a35161
commit
b10270b502
48 changed files with 892 additions and 699 deletions
|
|
@ -1,10 +1,11 @@
|
|||
package jet
|
||||
|
||||
// ColumnBool is interface for SQL boolean columns.
|
||||
type ColumnBool interface {
|
||||
BoolExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnBool
|
||||
From(subQuery SelectTable) ColumnBool
|
||||
}
|
||||
|
||||
type boolColumnImpl struct {
|
||||
|
|
@ -13,7 +14,7 @@ type boolColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *boolColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *boolColumnImpl) from(subQuery SelectTable) projection {
|
||||
newBoolColumn := BoolColumn(i.name)
|
||||
newBoolColumn.setTableName(i.tableName)
|
||||
newBoolColumn.setSubQuery(subQuery)
|
||||
|
|
@ -21,12 +22,13 @@ func (i *boolColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newBoolColumn
|
||||
}
|
||||
|
||||
func (i *boolColumnImpl) From(subQuery ExpressionTable) ColumnBool {
|
||||
func (i *boolColumnImpl) From(subQuery SelectTable) ColumnBool {
|
||||
newBoolColumn := i.from(subQuery).(ColumnBool)
|
||||
|
||||
return newBoolColumn
|
||||
}
|
||||
|
||||
// BoolColumn creates named bool column.
|
||||
func BoolColumn(name string) ColumnBool {
|
||||
boolColumn := &boolColumnImpl{}
|
||||
boolColumn.columnImpl = newColumn(name, "", boolColumn)
|
||||
|
|
@ -37,11 +39,12 @@ func BoolColumn(name string) ColumnBool {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnFloat is interface for SQL real, numeric, decimal or double precision column.
|
||||
type ColumnFloat interface {
|
||||
FloatExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnFloat
|
||||
From(subQuery SelectTable) ColumnFloat
|
||||
}
|
||||
|
||||
type floatColumnImpl struct {
|
||||
|
|
@ -49,7 +52,7 @@ type floatColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *floatColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *floatColumnImpl) from(subQuery SelectTable) projection {
|
||||
newFloatColumn := FloatColumn(i.name)
|
||||
newFloatColumn.setTableName(i.tableName)
|
||||
newFloatColumn.setSubQuery(subQuery)
|
||||
|
|
@ -57,12 +60,13 @@ func (i *floatColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newFloatColumn
|
||||
}
|
||||
|
||||
func (i *floatColumnImpl) From(subQuery ExpressionTable) ColumnFloat {
|
||||
func (i *floatColumnImpl) From(subQuery SelectTable) ColumnFloat {
|
||||
newFloatColumn := i.from(subQuery).(ColumnFloat)
|
||||
|
||||
return newFloatColumn
|
||||
}
|
||||
|
||||
// FloatColumn creates named float column.
|
||||
func FloatColumn(name string) ColumnFloat {
|
||||
floatColumn := &floatColumnImpl{}
|
||||
floatColumn.floatInterfaceImpl.parent = floatColumn
|
||||
|
|
@ -73,11 +77,12 @@ func FloatColumn(name string) ColumnFloat {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnInteger is interface for SQL smallint, integer, bigint columns.
|
||||
type ColumnInteger interface {
|
||||
IntegerExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnInteger
|
||||
From(subQuery SelectTable) ColumnInteger
|
||||
}
|
||||
|
||||
type integerColumnImpl struct {
|
||||
|
|
@ -86,7 +91,7 @@ type integerColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *integerColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *integerColumnImpl) from(subQuery SelectTable) projection {
|
||||
newIntColumn := IntegerColumn(i.name)
|
||||
newIntColumn.setTableName(i.tableName)
|
||||
newIntColumn.setSubQuery(subQuery)
|
||||
|
|
@ -94,10 +99,11 @@ func (i *integerColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newIntColumn
|
||||
}
|
||||
|
||||
func (i *integerColumnImpl) From(subQuery ExpressionTable) ColumnInteger {
|
||||
func (i *integerColumnImpl) From(subQuery SelectTable) ColumnInteger {
|
||||
return i.from(subQuery).(ColumnInteger)
|
||||
}
|
||||
|
||||
// IntegerColumn creates named integer column.
|
||||
func IntegerColumn(name string) ColumnInteger {
|
||||
integerColumn := &integerColumnImpl{}
|
||||
integerColumn.integerInterfaceImpl.parent = integerColumn
|
||||
|
|
@ -108,11 +114,13 @@ func IntegerColumn(name string) ColumnInteger {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnString is interface for SQL text, character, character varying
|
||||
// bytea, uuid columns and enums types.
|
||||
type ColumnString interface {
|
||||
StringExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnString
|
||||
From(subQuery SelectTable) ColumnString
|
||||
}
|
||||
|
||||
type stringColumnImpl struct {
|
||||
|
|
@ -121,7 +129,7 @@ type stringColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *stringColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *stringColumnImpl) from(subQuery SelectTable) projection {
|
||||
newStrColumn := StringColumn(i.name)
|
||||
newStrColumn.setTableName(i.tableName)
|
||||
newStrColumn.setSubQuery(subQuery)
|
||||
|
|
@ -129,10 +137,11 @@ func (i *stringColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newStrColumn
|
||||
}
|
||||
|
||||
func (i *stringColumnImpl) From(subQuery ExpressionTable) ColumnString {
|
||||
func (i *stringColumnImpl) From(subQuery SelectTable) ColumnString {
|
||||
return i.from(subQuery).(ColumnString)
|
||||
}
|
||||
|
||||
// StringColumn creates named string column.
|
||||
func StringColumn(name string) ColumnString {
|
||||
stringColumn := &stringColumnImpl{}
|
||||
stringColumn.stringInterfaceImpl.parent = stringColumn
|
||||
|
|
@ -143,11 +152,12 @@ func StringColumn(name string) ColumnString {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnTime is interface for SQL time column.
|
||||
type ColumnTime interface {
|
||||
TimeExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnTime
|
||||
From(subQuery SelectTable) ColumnTime
|
||||
}
|
||||
|
||||
type timeColumnImpl struct {
|
||||
|
|
@ -155,7 +165,7 @@ type timeColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *timeColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *timeColumnImpl) from(subQuery SelectTable) projection {
|
||||
newTimeColumn := TimeColumn(i.name)
|
||||
newTimeColumn.setTableName(i.tableName)
|
||||
newTimeColumn.setSubQuery(subQuery)
|
||||
|
|
@ -163,10 +173,11 @@ func (i *timeColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newTimeColumn
|
||||
}
|
||||
|
||||
func (i *timeColumnImpl) From(subQuery ExpressionTable) ColumnTime {
|
||||
func (i *timeColumnImpl) From(subQuery SelectTable) ColumnTime {
|
||||
return i.from(subQuery).(ColumnTime)
|
||||
}
|
||||
|
||||
// TimeColumn creates named time column
|
||||
func TimeColumn(name string) ColumnTime {
|
||||
timeColumn := &timeColumnImpl{}
|
||||
timeColumn.timeInterfaceImpl.parent = timeColumn
|
||||
|
|
@ -176,11 +187,12 @@ func TimeColumn(name string) ColumnTime {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnTimez is interface of SQL time with time zone columns.
|
||||
type ColumnTimez interface {
|
||||
TimezExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnTimez
|
||||
From(subQuery SelectTable) ColumnTimez
|
||||
}
|
||||
|
||||
type timezColumnImpl struct {
|
||||
|
|
@ -189,7 +201,7 @@ type timezColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *timezColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *timezColumnImpl) from(subQuery SelectTable) projection {
|
||||
newTimezColumn := TimezColumn(i.name)
|
||||
newTimezColumn.setTableName(i.tableName)
|
||||
newTimezColumn.setSubQuery(subQuery)
|
||||
|
|
@ -197,10 +209,11 @@ func (i *timezColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newTimezColumn
|
||||
}
|
||||
|
||||
func (i *timezColumnImpl) From(subQuery ExpressionTable) ColumnTimez {
|
||||
func (i *timezColumnImpl) From(subQuery SelectTable) ColumnTimez {
|
||||
return i.from(subQuery).(ColumnTimez)
|
||||
}
|
||||
|
||||
// TimezColumn creates named time with time zone column.
|
||||
func TimezColumn(name string) ColumnTimez {
|
||||
timezColumn := &timezColumnImpl{}
|
||||
timezColumn.timezInterfaceImpl.parent = timezColumn
|
||||
|
|
@ -211,11 +224,12 @@ func TimezColumn(name string) ColumnTimez {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnTimestamp is interface of SQL timestamp columns.
|
||||
type ColumnTimestamp interface {
|
||||
TimestampExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnTimestamp
|
||||
From(subQuery SelectTable) ColumnTimestamp
|
||||
}
|
||||
|
||||
type timestampColumnImpl struct {
|
||||
|
|
@ -224,7 +238,7 @@ type timestampColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *timestampColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *timestampColumnImpl) from(subQuery SelectTable) projection {
|
||||
newTimestampColumn := TimestampColumn(i.name)
|
||||
newTimestampColumn.setTableName(i.tableName)
|
||||
newTimestampColumn.setSubQuery(subQuery)
|
||||
|
|
@ -232,10 +246,11 @@ func (i *timestampColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newTimestampColumn
|
||||
}
|
||||
|
||||
func (i *timestampColumnImpl) From(subQuery ExpressionTable) ColumnTimestamp {
|
||||
func (i *timestampColumnImpl) From(subQuery SelectTable) ColumnTimestamp {
|
||||
return i.from(subQuery).(ColumnTimestamp)
|
||||
}
|
||||
|
||||
// TimestampColumn creates named timestamp column
|
||||
func TimestampColumn(name string) ColumnTimestamp {
|
||||
timestampColumn := ×tampColumnImpl{}
|
||||
timestampColumn.timestampInterfaceImpl.parent = timestampColumn
|
||||
|
|
@ -246,11 +261,12 @@ func TimestampColumn(name string) ColumnTimestamp {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnTimestampz is interface of SQL timestamp with timezone columns.
|
||||
type ColumnTimestampz interface {
|
||||
TimestampzExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnTimestampz
|
||||
From(subQuery SelectTable) ColumnTimestampz
|
||||
}
|
||||
|
||||
type timestampzColumnImpl struct {
|
||||
|
|
@ -259,7 +275,7 @@ type timestampzColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *timestampzColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *timestampzColumnImpl) from(subQuery SelectTable) projection {
|
||||
newTimestampzColumn := TimestampzColumn(i.name)
|
||||
newTimestampzColumn.setTableName(i.tableName)
|
||||
newTimestampzColumn.setSubQuery(subQuery)
|
||||
|
|
@ -267,10 +283,11 @@ func (i *timestampzColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newTimestampzColumn
|
||||
}
|
||||
|
||||
func (i *timestampzColumnImpl) From(subQuery ExpressionTable) ColumnTimestampz {
|
||||
func (i *timestampzColumnImpl) From(subQuery SelectTable) ColumnTimestampz {
|
||||
return i.from(subQuery).(ColumnTimestampz)
|
||||
}
|
||||
|
||||
// TimestampzColumn creates named timestamp with time zone column.
|
||||
func TimestampzColumn(name string) ColumnTimestampz {
|
||||
timestampzColumn := ×tampzColumnImpl{}
|
||||
timestampzColumn.timestampzInterfaceImpl.parent = timestampzColumn
|
||||
|
|
@ -281,11 +298,12 @@ func TimestampzColumn(name string) ColumnTimestampz {
|
|||
|
||||
//------------------------------------------------------//
|
||||
|
||||
// ColumnDate is interface of SQL date columns.
|
||||
type ColumnDate interface {
|
||||
DateExpression
|
||||
column
|
||||
|
||||
From(subQuery ExpressionTable) ColumnDate
|
||||
From(subQuery SelectTable) ColumnDate
|
||||
}
|
||||
|
||||
type dateColumnImpl struct {
|
||||
|
|
@ -294,7 +312,7 @@ type dateColumnImpl struct {
|
|||
columnImpl
|
||||
}
|
||||
|
||||
func (i *dateColumnImpl) from(subQuery ExpressionTable) projection {
|
||||
func (i *dateColumnImpl) from(subQuery SelectTable) projection {
|
||||
newDateColumn := DateColumn(i.name)
|
||||
newDateColumn.setTableName(i.tableName)
|
||||
newDateColumn.setSubQuery(subQuery)
|
||||
|
|
@ -302,10 +320,11 @@ func (i *dateColumnImpl) from(subQuery ExpressionTable) projection {
|
|||
return newDateColumn
|
||||
}
|
||||
|
||||
func (i *dateColumnImpl) From(subQuery ExpressionTable) ColumnDate {
|
||||
func (i *dateColumnImpl) From(subQuery SelectTable) ColumnDate {
|
||||
return i.from(subQuery).(ColumnDate)
|
||||
}
|
||||
|
||||
// DateColumn creates named date column.
|
||||
func DateColumn(name string) ColumnDate {
|
||||
dateColumn := &dateColumnImpl{}
|
||||
dateColumn.dateInterfaceImpl.parent = dateColumn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue