Update comments.
This commit is contained in:
parent
6e446ee100
commit
641c62098c
2 changed files with 4 additions and 4 deletions
|
|
@ -38,7 +38,7 @@ const (
|
||||||
// Interval is representation of MySQL interval
|
// Interval is representation of MySQL interval
|
||||||
type Interval = jet.Interval
|
type Interval = jet.Interval
|
||||||
|
|
||||||
// INTERVAL creates new Interval type.
|
// INTERVAL creates new temporal interval.
|
||||||
// In a case of MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR unit type
|
// In a case of MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR unit type
|
||||||
// value parameter should be number. For example: INTERVAL(1, DAY)
|
// value parameter should be number. For example: INTERVAL(1, DAY)
|
||||||
// In a case of other unit types, value should be string with appropriate format.
|
// In a case of other unit types, value should be string with appropriate format.
|
||||||
|
|
@ -94,7 +94,7 @@ func INTERVAL(value interface{}, unitType unitType) Interval {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// INTERVALe creates new Interval type from expresion and unit type.
|
// INTERVALe creates new temporal interval from expresion and unit type.
|
||||||
func INTERVALe(expr Expression, unitType unitType) Interval {
|
func INTERVALe(expr Expression, unitType unitType) Interval {
|
||||||
return jet.NewInterval(jet.ListSerializer{
|
return jet.NewInterval(jet.ListSerializer{
|
||||||
Serializers: []jet.Serializer{expr, jet.Raw(string(unitType))},
|
Serializers: []jet.Serializer{expr, jet.Raw(string(unitType))},
|
||||||
|
|
@ -102,7 +102,7 @@ func INTERVALe(expr Expression, unitType unitType) Interval {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// INTERVALd returns a interval representation from duration
|
// INTERVALd temoral interval from time.Duration
|
||||||
func INTERVALd(duration time.Duration) Interval {
|
func INTERVALd(duration time.Duration) Interval {
|
||||||
var sign int64 = 1
|
var sign int64 = 1
|
||||||
if duration < 0 {
|
if duration < 0 {
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ func INTERVAL(quantityAndUnit ...quantityAndUnit) IntervalExpression {
|
||||||
return newInterval
|
return newInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
// INTERVALd creates interval expression from duration
|
// INTERVALd creates interval expression from time.Duration
|
||||||
func INTERVALd(duration time.Duration) IntervalExpression {
|
func INTERVALd(duration time.Duration) IntervalExpression {
|
||||||
days, hours, minutes, seconds, microseconds := utils.ExtractDateTimeComponents(duration)
|
days, hours, minutes, seconds, microseconds := utils.ExtractDateTimeComponents(duration)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue