Documentation
¶
Index ¶
- func NewCatalog() *catalog.Catalog
- func NewIdentifier(t string) *ast.String
- type Parser
- func (p *Parser) Cast(arg, typeName string) string
- func (p *Parser) CommentSyntax() source.CommentSyntax
- func (p *Parser) IsReservedKeyword(s string) bool
- func (p *Parser) NamedParam(name string) string
- func (p *Parser) Param(n int) string
- func (p *Parser) Parse(r io.Reader) ([]ast.Statement, error)
- func (p *Parser) QuoteIdent(s string) string
- func (p *Parser) TypeName(ns, name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCatalog ¶
func NewIdentifier ¶
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Cast ¶ added in v1.31.0
Cast returns a type cast expression. MySQL uses CAST(expr AS type) syntax.
func (*Parser) CommentSyntax ¶
func (p *Parser) CommentSyntax() source.CommentSyntax
func (*Parser) IsReservedKeyword ¶
func (*Parser) NamedParam ¶ added in v1.31.0
NamedParam returns the named parameter placeholder for the given name. MySQL doesn't have native named parameters, so we use ? (positional). The actual parameter names are handled by sqlc's rewrite phase.
func (*Parser) Param ¶ added in v1.31.0
Param returns the parameter placeholder for the given number. MySQL uses ? for all parameters (positional).
func (*Parser) QuoteIdent ¶ added in v1.31.0
QuoteIdent returns a quoted identifier if it needs quoting. MySQL uses backticks for quoting identifiers.
Click to show internal directories.
Click to hide internal directories.