Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 72 for expressions (0.22 sec)

  1. tests/sql_builder_test.go

    	newDB.Clauses(
    		clause.From{
    			Tables: []clause.Table{{Name: "users"}},
    			Joins: []clause.Join{
    				{
    					Table: clause.Table{Name: "companies", Raw: false},
    					ON: clause.Where{
    						Exprs: []clause.Expression{
    							clause.Eq{
    								Column: clause.Column{
    									Table: "users",
    									Name:  "company_id",
    								},
    								Value: clause.Column{
    									Table: "companies",
    									Name:  "id",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  2. tests/query_test.go

    		t.Fatalf("Build Order condition, but got %v", result.Statement.SQL.String())
    	}
    
    	stmt := dryDB.Clauses(clause.OrderBy{
    		Expression: clause.Expr{SQL: "FIELD(id,?)", Vars: []interface{}{[]int{1, 2, 3}}, WithoutParentheses: true},
    	}).Find(&User{}).Statement
    
    	explainedSQL := dryDB.Dialector.Explain(stmt.SQL.String(), stmt.Vars...)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  3. internal/s3select/unused-errors.go

    		message:    "Did not find the expected identifier for AT name in the SQL expression.",
    		statusCode: 400,
    		cause:      err,
    	}
    }
    
    func errParseCannotMixSqbAndWildcardInSelectList(err error) *s3Error {
    	return &s3Error{
    		code:       "ParseCannotMixSqbAndWildcardInSelectList",
    		message:    "Cannot mix [] and * in the same expression in a SELECT list in SQL expression.",
    		statusCode: 400,
    		cause:      err,
    	}
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Feb 20 08:16:35 GMT 2024
    - 17.5K bytes
    - Viewed (0)
  4. statement.go

    				// looks like a where condition
    				return []clause.Expression{clause.Expr{SQL: s, Vars: args}}
    			}
    
    			if len(args) > 0 && strings.Contains(s, "@") {
    				// looks like a named query
    				return []clause.Expression{clause.NamedExpr{SQL: s, Vars: args}}
    			}
    
    			if strings.Contains(strings.TrimSpace(s), " ") {
    				// looks like a where condition
    				return []clause.Expression{clause.Expr{SQL: s, Vars: args}}
    			}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  5. internal/s3select/sql/errors.go

    }
    
    func (err *s3Error) Error() string {
    	return err.message
    }
    
    func errInvalidDataType(err error) *s3Error {
    	return &s3Error{
    		code:       "InvalidDataType",
    		message:    "The SQL expression contains an invalid data type.",
    		statusCode: 400,
    		cause:      err,
    	}
    }
    
    func errIncorrectSQLFunctionArgumentType(err error) *s3Error {
    	return &s3Error{
    		code:       "IncorrectSqlFunctionArgumentType",
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 2.6K bytes
    - Viewed (0)
  6. callbacks/helper.go

    		}
    	}
    	return
    }
    
    func hasReturning(tx *gorm.DB, supportReturning bool) (bool, gorm.ScanMode) {
    	if supportReturning {
    		if c, ok := tx.Statement.Clauses["RETURNING"]; ok {
    			returning, _ := c.Expression.(clause.Returning)
    			if len(returning.Columns) == 0 || (len(returning.Columns) == 1 && returning.Columns[0].Name == "*") {
    				return true, 0
    			}
    			return true, gorm.ScanUpdate
    		}
    	}
    	return false, 0
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  7. callbacks/update.go

    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    				}
    			}
    		case reflect.Struct:
    			for _, field := range stmt.Schema.PrimaryFields {
    				if value, isZero := field.ValueOf(stmt.Context, stmt.ReflectValue); !isZero {
    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.Eq{Column: field.DBName, Value: value}}})
    				}
    			}
    		}
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  8. clause/order_by_test.go

    				},
    			},
    			"SELECT * FROM `users` ORDER BY `name`", nil,
    		},
    		{
    			[]clause.Interface{
    				clause.Select{}, clause.From{}, clause.OrderBy{
    					Expression: clause.Expr{SQL: "FIELD(id, ?)", Vars: []interface{}{[]int{1, 2, 3}}, WithoutParentheses: true},
    				},
    			},
    			"SELECT * FROM `users` ORDER BY FIELD(id, ?,?,?)",
    			[]interface{}{1, 2, 3},
    		},
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  9. utils/tests/dummy_dialecter.go

    		DeleteClauses:        []string{"DELETE", "FROM", "WHERE", "RETURNING"},
    		LastInsertIDReversed: true,
    	})
    
    	return nil
    }
    
    func (DummyDialector) DefaultValueOf(field *schema.Field) clause.Expression {
    	return clause.Expr{SQL: "DEFAULT"}
    }
    
    func (DummyDialector) Migrator(*gorm.DB) gorm.Migrator {
    	return nil
    }
    
    func (DummyDialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{}) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 06 06:03:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  10. interfaces.go

    )
    
    // Dialector GORM database dialector
    type Dialector interface {
    	Name() string
    	Initialize(*DB) error
    	Migrator(db *DB) Migrator
    	DataTypeOf(*schema.Field) string
    	DefaultValueOf(*schema.Field) clause.Expression
    	BindVarTo(writer clause.Writer, stmt *Statement, v interface{})
    	QuoteTo(clause.Writer, string)
    	Explain(sql string, vars ...interface{}) string
    }
    
    // Plugin GORM plugin interface
    type Plugin interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
Back to top