Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for Writer (0.58 sec)

  1. statement.go

    		writer.WriteByte('(')
    		for idx, d := range v {
    			if idx > 0 {
    				writer.WriteByte(',')
    			}
    			stmt.QuoteTo(writer, d)
    		}
    		writer.WriteByte(')')
    	case clause.Expr:
    		v.Build(stmt)
    	case string:
    		stmt.DB.Dialector.QuoteTo(writer, v)
    	case []string:
    		writer.WriteByte('(')
    		for idx, d := range v {
    			if idx > 0 {
    				writer.WriteByte(',')
    			}
    			stmt.DB.Dialector.QuoteTo(writer, d)
    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)
  2. logger/logger.go

    const (
    	// Silent silent log level
    	Silent LogLevel = iota + 1
    	// Error error log level
    	Error
    	// Warn warn log level
    	Warn
    	// Info info log level
    	Info
    )
    
    // Writer log writer interface
    type Writer interface {
    	Printf(string, ...interface{})
    }
    
    // Config logger config
    type Config struct {
    	SlowThreshold             time.Duration
    	Colorful                  bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:19:41 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  3. interfaces.go

    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 {
    	Name() string
    	Initialize(*DB) error
    }
    
    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)
  4. prepare_stmt.go

    package gorm
    
    import (
    	"context"
    	"database/sql"
    	"database/sql/driver"
    	"errors"
    	"reflect"
    	"sync"
    )
    
    type Stmt struct {
    	*sql.Stmt
    	Transaction bool
    	prepared    chan struct{}
    	prepareErr  error
    }
    
    type PreparedStmtDB struct {
    	Stmts       map[string]*Stmt
    	PreparedSQL []string
    	Mux         *sync.RWMutex
    	ConnPool
    }
    
    func NewPreparedStmtDB(connPool ConnPool) *PreparedStmtDB {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  5. tests/scanner_valuer_test.go

    package tests_test
    
    import (
    	"context"
    	"database/sql"
    	"database/sql/driver"
    	"encoding/json"
    	"errors"
    	"fmt"
    	"reflect"
    	"regexp"
    	"strconv"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestScannerValuer(t *testing.T) {
    	DB.Migrator().DropTable(&ScannerValuerStruct{})
    	if err := DB.Migrator().AutoMigrate(&ScannerValuerStruct{}); err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  6. schema/serializer.go

    	fieldValue      interface{}
    }
    
    // Scan implements sql.Scanner interface
    func (s *serializer) Scan(value interface{}) error {
    	s.value = value
    	return nil
    }
    
    // Value implements driver.Valuer interface
    func (s serializer) Value() (driver.Value, error) {
    	return s.SerializeValuer.Value(s.Context, s.Field, s.Destination, s.fieldValue)
    }
    
    // SerializerInterface serializer interface
    type SerializerInterface interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  7. tests/embedded_struct_test.go

    	}
    }
    
    type Content struct {
    	Content interface{} `gorm:"type:String"`
    }
    
    func (c Content) Value() (driver.Value, error) {
    	// mssql driver with issue on handling null bytes https://github.com/denisenkom/go-mssqldb/issues/530,
    	b, err := json.Marshal(c)
    	return string(b[:]), err
    }
    
    func (c *Content) Scan(src interface{}) error {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  8. scan.go

    package gorm
    
    import (
    	"database/sql"
    	"database/sql/driver"
    	"reflect"
    	"time"
    
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    // prepareValues prepare values slice
    func prepareValues(values []interface{}, db *DB, columnTypes []*sql.ColumnType, columns []string) {
    	if db.Statement.Schema != nil {
    		for idx, name := range columns {
    			if field := db.Statement.Schema.LookUpField(name); field != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  9. tests/connpool_test.go

    package tests_test
    
    import (
    	"context"
    	"database/sql"
    	"os"
    	"reflect"
    	"testing"
    
    	"gorm.io/driver/mysql"
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    type wrapperTx struct {
    	*sql.Tx
    	conn *wrapperConnPool
    }
    
    func (c *wrapperTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.PrepareContext(ctx, query)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  10. utils/utils.go

    	yval := reflect.ValueOf(y)
    	if xval.Kind() == reflect.Ptr && xval.IsNil() ||
    		yval.Kind() == reflect.Ptr && yval.IsNil() {
    		return false
    	}
    
    	if valuer, ok := x.(driver.Valuer); ok {
    		x, _ = valuer.Value()
    	}
    	if valuer, ok := y.(driver.Valuer); ok {
    		y, _ = valuer.Value()
    	}
    	return reflect.DeepEqual(x, y)
    }
    
    func ToString(value interface{}) string {
    	switch v := value.(type) {
    	case string:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
Back to top