snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
This commit is contained in:
36
internal/sql/ast/between_expr.go
Normal file
36
internal/sql/ast/between_expr.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package ast
|
||||
|
||||
import "github.com/sqlc-dev/sqlc/internal/sql/format"
|
||||
|
||||
type BetweenExpr struct {
|
||||
Tag NodeTag[BetweenExpr] `json:"tag"`
|
||||
|
||||
// Expr is the value expression to be compared.
|
||||
Expr Node `json:"expr,omitempty"`
|
||||
// Left is the left expression in the between statement.
|
||||
Left Node `json:"left,omitempty"`
|
||||
// Right is the right expression in the between statement.
|
||||
Right Node `json:"right,omitempty"`
|
||||
// Not is true, the expression is "not between".
|
||||
Not bool `json:"not"`
|
||||
Location int `json:"location"`
|
||||
}
|
||||
|
||||
func (n *BetweenExpr) Pos() int {
|
||||
return n.Location
|
||||
}
|
||||
|
||||
func (n *BetweenExpr) Format(buf *TrackedBuffer, d format.Dialect) {
|
||||
if n == nil {
|
||||
return
|
||||
}
|
||||
buf.astFormat(n.Expr, d)
|
||||
if n.Not {
|
||||
buf.WriteString(" NOT BETWEEN ")
|
||||
} else {
|
||||
buf.WriteString(" BETWEEN ")
|
||||
}
|
||||
buf.astFormat(n.Left, d)
|
||||
buf.WriteString(" AND ")
|
||||
buf.astFormat(n.Right, d)
|
||||
}
|
||||
Reference in New Issue
Block a user