/
githubmirror
/
sqlc
Обзор
Документация
Войти
/
githubmirror
/
sqlc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
internal/sql/ast/interval_expr.go
24 строки
481 B
Kyle Gray
refactor(ast): rename Formatter interface to Dialect (#4208)
01 дек 2025, 04:49
Не верифицирован
01 дек 2025, 04:49
ebd32cf
Код
Авторство
О чём код?
package ast import "github.com/sqlc-dev/sqlc/internal/sql/format" // IntervalExpr represents a MySQL INTERVAL expression like "INTERVAL 1 DAY" type IntervalExpr struct { Value Node Unit string Location int } func (n *IntervalExpr) Pos() int { return n.Location } func (n *IntervalExpr) Format(buf *TrackedBuffer, d format.Dialect) { if n == nil { return } buf.WriteString("INTERVAL ") buf.astFormat(n.Value, d) buf.WriteString(" ") buf.WriteString(n.Unit) }