Documentation
¶
Index ¶
- Variables
- func BinaryExpr(left *models.Expression, op string, right *models.Expression) *models.Expression
- func CaseExpr(conditions []*models.CaseCondition, elseExpr *models.Expression) *models.Expression
- func ConvertCaseExpression(expr map[string]interface{}) *models.Expression
- func ConvertExtendedRedisCommand(parts []string) (*models.Query, error)
- func ConvertRedisExists(parts []string) (*models.Query, error)
- func ConvertRedisHDel(parts []string) (*models.Query, error)
- func ConvertRedisHGet(parts []string) (*models.Query, error)
- func ConvertRedisKeys(parts []string) (*models.Query, error)
- func ConvertRedisLPush(parts []string) (*models.Query, error)
- func ConvertRedisLRange(parts []string) (*models.Query, error)
- func ConvertRedisSAdd(parts []string) (*models.Query, error)
- func ConvertRedisSMembers(parts []string) (*models.Query, error)
- func ConvertRedisToReplace(parts []string) (*models.Query, error)
- func ConvertRedisToUpsert(parts []string) (*models.Query, error)
- func ConvertRedisZAdd(parts []string) (*models.Query, error)
- func ConvertRedisZRange(parts []string) (*models.Query, error)
- func ConvertSetExpression(expr map[string]interface{}) (*models.SetOperation, string)
- func EntityToTable(entity string) string
- func ExtractTenantFromACL(args []string) string
- func ExtractTenantFromKey(key string) string
- func FieldExpr(name string) *models.Expression
- func FunctionExpr(name string, args ...*models.Expression) *models.Expression
- func GetOQLOperation(sqlOp, dbType string) string
- func GetOQLOperator(sqlOp, dbType string) string
- func GetOQLType(sqlType, dbType string) string
- func LiteralExpr(value string) *models.Expression
- func MongoDBToQuery(jsonStr string) (*models.Query, error)
- func MySQLToQuery(sql string) (*models.Query, error)
- func NewCondition(field *models.Expression, op string, value *models.Expression) models.Condition
- func NewConditionWithLogic(field *models.Expression, op string, value *models.Expression, logic string) models.Condition
- func ParseComplexRedisValue(value string) *models.Expression
- func ParseJSONToFields(jsonStr string) []models.Field
- func PostgreSQLToQuery(sql string) (*models.Query, error)
- func ProcessAdvancedPipelineStages(query *models.Query, pipeline []interface{}) bool
- func RedisToQuery(commandStr string) (*models.Query, error)
- func TableToEntity(table string) string
- func ToQuery(query string, dbType string) (*models.Query, error)
- func WindowExpr(partitionBy []*models.Expression, orderBy []models.OrderBy, ...) *models.Expression
- type RedisKeyInfo
- type RedisKeyPattern
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BinaryExpr ¶
func BinaryExpr(left *models.Expression, op string, right *models.Expression) *models.Expression
func CaseExpr ¶
func CaseExpr(conditions []*models.CaseCondition, elseExpr *models.Expression) *models.Expression
func ConvertCaseExpression ¶
func ConvertCaseExpression(expr map[string]interface{}) *models.Expression
ConvertCaseExpression handles $cond and $switch
func ConvertExtendedRedisCommand ¶
ConvertExtendedRedisCommand handles additional Redis commands Called from main router when basic commands don't match
func ConvertRedisExists ¶
ConvertRedisExists converts EXISTS to COUNT with condition
func ConvertRedisHDel ¶
ConvertRedisHDel converts HDEL to UPDATE with NULL
func ConvertRedisHGet ¶
ConvertRedisHGet converts HGET to GET specific field
func ConvertRedisKeys ¶
ConvertRedisKeys converts KEYS pattern to GET with LIKE
func ConvertRedisLPush ¶
ConvertRedisLPush converts LPUSH to array append operation
func ConvertRedisLRange ¶
ConvertRedisLRange converts LRANGE to GET with array slice
func ConvertRedisSAdd ¶
ConvertRedisSAdd converts SADD to set add operation
func ConvertRedisSMembers ¶
ConvertRedisSMembers converts SMEMBERS to GET set members
func ConvertRedisToReplace ¶
ConvertRedisToReplace converts HMSET to REPLACE REPLACE = DELETE + INSERT (full document replacement)
func ConvertRedisToUpsert ¶
ConvertRedisToUpsert converts HMSET to UPSERT when detected Redis doesn't distinguish CREATE vs UPSERT - HMSET always upserts We detect UPSERT context from key pattern or explicit marker
func ConvertRedisZAdd ¶
ConvertRedisZAdd converts ZADD to sorted set add
func ConvertRedisZRange ¶
ConvertRedisZRange converts ZRANGE to GET with ORDER BY
func ConvertSetExpression ¶
func ConvertSetExpression(expr map[string]interface{}) (*models.SetOperation, string)
ConvertSetExpression handles $setIntersection, $setDifference in $project Mapping: INTERSECT, EXCEPT
func EntityToTable ¶
EntityToTable: User → users, OrderItem → order_items
func ExtractTenantFromACL ¶
ExtractTenantFromACL extracts tenant pattern from ACL args Looks for ~tenant:XXX:* pattern
func ExtractTenantFromKey ¶
ExtractTenantFromKey extracts tenant ID from Redis key
func FieldExpr ¶
func FieldExpr(name string) *models.Expression
func FunctionExpr ¶
func FunctionExpr(name string, args ...*models.Expression) *models.Expression
func GetOQLOperation ¶
func GetOQLOperator ¶
func GetOQLType ¶
func LiteralExpr ¶
func LiteralExpr(value string) *models.Expression
func NewCondition ¶
func NewCondition(field *models.Expression, op string, value *models.Expression) models.Condition
func NewConditionWithLogic ¶
func NewConditionWithLogic(field *models.Expression, op string, value *models.Expression, logic string) models.Condition
func ParseComplexRedisValue ¶
func ParseComplexRedisValue(value string) *models.Expression
ParseComplexRedisValue parses complex values including expressions
func ParseJSONToFields ¶
ParseJSONToFields converts JSON string to Fields with type inference
func ProcessAdvancedPipelineStages ¶
ProcessAdvancedPipelineStages handles advanced aggregation stages
func RedisToQuery ¶
RedisToQuery converts a Redis command string to an OQL Query
func TableToEntity ¶
TableToEntity: users → User, order_items → OrderItem
func WindowExpr ¶
func WindowExpr(partitionBy []*models.Expression, orderBy []models.OrderBy, offset, buckets int) *models.Expression
Types ¶
type RedisKeyInfo ¶
type RedisKeyInfo struct {
TenantID string
Entity string
ID string
Field string // For field:value pattern
FieldValue string
IsPattern bool // true if key ends with *
}
RedisKeyInfo contains parsed information from a Redis key
type RedisKeyPattern ¶
type RedisKeyPattern struct {
TenantID string
Entity string
ID string
Segments []string // All key segments
IsPattern bool
PatternType string // "exact", "prefix", "suffix", "contains"
}
RedisKeyPattern represents advanced key pattern info
func ParseRedisKeyPattern ¶
func ParseRedisKeyPattern(key string) *RedisKeyPattern
ParseRedisKeyPattern parses key with advanced pattern detection
func (*RedisKeyPattern) ToConditions ¶
func (p *RedisKeyPattern) ToConditions() []models.Condition
ToConditions converts key pattern to OQL conditions