Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 72 for expression (0.2 sec)

  1. clause/expression.go

    import (
    	"database/sql"
    	"database/sql/driver"
    	"go/ast"
    	"reflect"
    )
    
    // Expression expression interface
    type Expression interface {
    	Build(builder Builder)
    }
    
    // NegationExpressionBuilder negation expression builder
    type NegationExpressionBuilder interface {
    	NegationBuild(builder Builder)
    }
    
    // Expr raw expression
    type Expr struct {
    	SQL                string
    	Vars               []interface{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  2. clause/expression_test.go

    	column := "column-name"
    	results := []struct {
    		Expressions  []clause.Expression
    		ExpectedVars []interface{}
    		Result       string
    	}{{
    		Expressions: []clause.Expression{
    			clause.Eq{Column: column, Value: "column-value"},
    		},
    		ExpectedVars: []interface{}{"column-value"},
    		Result:       "`column-name` = ?",
    	}, {
    		Expressions: []clause.Expression{
    			clause.Eq{Column: column, Value: nil},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Aug 10 05:34:33 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  3. cmd/api-errors.go

    		HTTPStatusCode: http.StatusBadRequest,
    	},
    	ErrParseExpectedKeyword: {
    		Code:           "ParseExpectedKeyword",
    		Description:    "Did not find the expected keyword in the SQL expression.",
    		HTTPStatusCode: http.StatusBadRequest,
    	},
    	ErrParseExpectedTokenType: {
    		Code:           "ParseExpectedTokenType",
    		Description:    "Did not find the expected token in the SQL expression.",
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun May 05 16:56:21 GMT 2024
    - 91.4K bytes
    - Viewed (6)
  4. clause/clause.go

    type Clause struct {
    	Name                string // WHERE
    	BeforeExpression    Expression
    	AfterNameExpression Expression
    	AfterExpression     Expression
    	Expression          Expression
    	Builder             ClauseBuilder
    }
    
    // Build build clause
    func (c Clause) Build(builder Builder) {
    	if c.Builder != nil {
    		c.Builder(c, builder)
    	} else if c.Expression != nil {
    		if c.BeforeExpression != nil {
    			c.BeforeExpression.Build(builder)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Feb 02 09:15:08 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  5. clause/joins_test.go

    			},
    			sql: "INNER JOIN `user` USING (`id`)",
    		},
    		{
    			name: "Expression",
    			join: clause.Join{
    				// Invalid
    				Type:  clause.LeftJoin,
    				Table: clause.Table{Name: "user"},
    				ON: clause.Where{
    					Exprs: []clause.Expression{clause.Eq{clause.Column{Table: "user_info", Name: "user_id"}, clause.PrimaryColumn}},
    				},
    				// Valid
    				Expression: clause.Join{
    					Type:  clause.InnerJoin,
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Nov 03 13:03:13 GMT 2022
    - 2.6K bytes
    - Viewed (0)
  6. clause/joins.go

    )
    
    // Join clause for from
    type Join struct {
    	Type       JoinType
    	Table      Table
    	ON         Where
    	Using      []string
    	Expression Expression
    }
    
    func (join Join) Build(builder Builder) {
    	if join.Expression != nil {
    		join.Expression.Build(builder)
    	} else {
    		if join.Type != "" {
    			builder.WriteString(string(join.Type))
    			builder.WriteByte(' ')
    		}
    
    		builder.WriteString("JOIN ")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Nov 03 13:03:13 GMT 2022
    - 901 bytes
    - Viewed (0)
  7. clause/order_by.go

    	Desc    bool
    	Reorder bool
    }
    
    type OrderBy struct {
    	Columns    []OrderByColumn
    	Expression Expression
    }
    
    // Name where clause name
    func (orderBy OrderBy) Name() string {
    	return "ORDER BY"
    }
    
    // Build build where clause
    func (orderBy OrderBy) Build(builder Builder) {
    	if orderBy.Expression != nil {
    		orderBy.Expression.Build(builder)
    	} else {
    		for idx, column := range orderBy.Columns {
    			if idx > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 03 02:30:05 GMT 2020
    - 1.1K bytes
    - Viewed (0)
  8. callbacks/delete.go

    				}
    
    				if !withoutConditions && db.AddError(tx.Clauses(clause.Where{Exprs: queryConds}).Delete(modelValue).Error) != nil {
    					return
    				}
    			case schema.Many2Many:
    				var (
    					queryConds     = make([]clause.Expression, 0, len(rel.References))
    					foreignFields  = make([]*schema.Field, 0, len(rel.References))
    					relForeignKeys = make([]string, 0, len(rel.References))
    					modelValue     = reflect.New(rel.JoinTable.ModelType).Interface()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
  9. internal/s3select/select_test.go

    		},
    		{
    			name:       "in-expression-precedence-1",
    			query:      "select * from s3object s where 'bar' in s.synonyms and s.id = 0",
    			wantResult: `{"id":0,"title":"Test Record","desc":"Some text","synonyms":["foo","bar","whatever"]}`,
    		},
    		{
    			name:       "in-expression-precedence-2",
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Dec 23 07:19:11 GMT 2023
    - 76.2K bytes
    - Viewed (0)
  10. internal/s3select/sql/utils.go

    	if o.Lit != nil {
    		return string(*o.Lit)
    	}
    	return o.ID.String()
    }
    
    // getLastKeypathComponent checks if the given expression is a path
    // expression, and if so extracts the last dot separated component of
    // the path. Otherwise it returns false.
    func getLastKeypathComponent(e *Expression) (string, bool) {
    	if len(e.And) > 1 ||
    		len(e.And[0].Condition) > 1 ||
    		e.And[0].Condition[0].Not != nil ||
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Nov 10 16:12:50 GMT 2021
    - 3.6K bytes
    - Viewed (0)
Back to top