Documentation
¶
Index ¶
- Constants
- Variables
- func IsParsingError(err error) bool
- func IsUnknownIdentifier(err error) bool
- func IsUnsupportedOperation(err error) bool
- type Identifier
- type IdentifierType
- type JSONElement
- type JSONLeaf
- type JSONTree
- type ParsingError
- type SQLWhereCondition
- type Translator
- type TranslatorDialect
- type UnknownIdentifierError
- type UnsupportedOperationError
Constants ¶
View Source
const ( IdentifierTypeInt = IdentifierType(internal.ExprTypeIntIdentifier) IdentifierTypeFloat = IdentifierType(internal.ExprTypeFloatIdentifier) IdentifierTypeBool = IdentifierType(internal.ExprTypeBoolIdentifier) IdentifierTypeString = IdentifierType(internal.ExprTypeStringIdentifier) IdentifierTypeTimestamp = IdentifierType(internal.ExprTypeTimestampIdentifier) IdentifierTypeJSON = IdentifierType(internal.ExprTypeJSONIdentifier) )
Variables ¶
View Source
var ErrInvalidFilter = errors.New("invalid filter")
Functions ¶
func IsParsingError ¶
func IsUnknownIdentifier ¶
func IsUnsupportedOperation ¶
Types ¶
type Identifier ¶
type Identifier struct {
ExprName string
DBName string
Type IdentifierType
JSONSpec JSONTree
}
type IdentifierType ¶
type JSONElement ¶
type JSONElement interface {
IdentifierType() IdentifierType
}
type JSONLeaf ¶
type JSONLeaf IdentifierType
func (JSONLeaf) IdentifierType ¶
func (l JSONLeaf) IdentifierType() IdentifierType
type JSONTree ¶
type JSONTree map[string]JSONElement
func (JSONTree) IdentifierType ¶
func (l JSONTree) IdentifierType() IdentifierType
type ParsingError ¶
type ParsingError struct {
Err error
}
func (*ParsingError) Error ¶
func (e *ParsingError) Error() string
type SQLWhereCondition ¶
type SQLWhereCondition string
type Translator ¶
type Translator interface {
Translate(query string) (SQLWhereCondition, error)
}
func NewTranslator ¶
func NewTranslator(allowedIdentifiers []Identifier, _ TranslatorDialect) Translator
type TranslatorDialect ¶
type TranslatorDialect byte
const (
TranslatorDialectPostgres TranslatorDialect = iota + 1
)
type UnknownIdentifierError ¶
type UnknownIdentifierError struct {
// contains filtered or unexported fields
}
func (*UnknownIdentifierError) Error ¶
func (e *UnknownIdentifierError) Error() string
type UnsupportedOperationError ¶
type UnsupportedOperationError struct {
// contains filtered or unexported fields
}
func (*UnsupportedOperationError) Error ¶
func (e *UnsupportedOperationError) Error() string
Click to show internal directories.
Click to hide internal directories.