Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for Writer (0.21 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  2. utils/tests/dummy_dialecter.go

    	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{}) {
    	writer.WriteByte('?')
    }
    
    func (DummyDialector) QuoteTo(writer clause.Writer, str string) {
    	var (
    		underQuoted, selfQuoted bool
    		continuousBacktick      int8
    		shiftDelimiter          int8
    	)
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 06 06:03:31 GMT 2023
    - 2.2K 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 Apr 21 09:35:09 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 Apr 21 09:35:09 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  6. tests/connection_test.go

    package tests_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/driver/mysql"
    	"gorm.io/gorm"
    )
    
    func TestWithSingleConnection(t *testing.T) {
    	expectedName := "test"
    	var actualName string
    
    	setSQL, getSQL := getSetSQL(DB.Dialector.Name())
    	if len(setSQL) == 0 || len(getSQL) == 0 {
    		return
    	}
    
    	err := DB.Connection(func(tx *gorm.DB) error {
    		if err := tx.Exec(setSQL, expectedName).Error; err != nil {
    			return err
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 28 14:16:42 GMT 2022
    - 963 bytes
    - Viewed (0)
  7. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Nov 07 02:19:41 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  8. clause/clause.go

    // ClauseBuilder clause builder, allows to customize how to build clause
    type ClauseBuilder func(Clause, Builder)
    
    type Writer interface {
    	WriteByte(byte) error
    	WriteString(string) (int, error)
    }
    
    // Builder builder interface
    type Builder interface {
    	Writer
    	WriteQuoted(field interface{})
    	AddVar(Writer, ...interface{})
    	AddError(error) error
    }
    
    // Clause
    type Clause struct {
    	Name                string // WHERE
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Feb 02 09:15:08 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  9. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  10. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
Back to top