Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for Writer (0.17 sec)

  1. 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 28 09:35:09 GMT 2024
    - Last Modified: Tue Nov 07 02:19:41 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  2. 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 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  3. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  4. logger/sql.go

    package logger
    
    import (
    	"database/sql/driver"
    	"fmt"
    	"reflect"
    	"regexp"
    	"strconv"
    	"strings"
    	"time"
    	"unicode"
    
    	"gorm.io/gorm/utils"
    )
    
    const (
    	tmFmtWithMS = "2006-01-02 15:04:05.999"
    	tmFmtZero   = "0000-00-00 00:00:00"
    	nullStr     = "NULL"
    )
    
    func isPrintable(s string) bool {
    	for _, r := range s {
    		if !unicode.IsPrint(r) {
    			return false
    		}
    	}
    	return true
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  5. errors.go

    	ErrSubQueryRequired = errors.New("sub query required")
    	// ErrInvalidData unsupported data
    	ErrInvalidData = errors.New("unsupported data")
    	// ErrUnsupportedDriver unsupported driver
    	ErrUnsupportedDriver = errors.New("unsupported driver")
    	// ErrRegistered registered
    	ErrRegistered = errors.New("registered")
    	// ErrInvalidField invalid field
    	ErrInvalidField = errors.New("invalid field")
    	// ErrEmptySlice empty slice found
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  6. logger/sql_test.go

    package logger_test
    
    import (
    	"database/sql/driver"
    	"encoding/json"
    	"fmt"
    	"regexp"
    	"strings"
    	"testing"
    
    	"github.com/jinzhu/now"
    	"gorm.io/gorm/logger"
    )
    
    type JSON json.RawMessage
    
    func (j JSON) Value() (driver.Value, error) {
    	if len(j) == 0 {
    		return nil, nil
    	}
    	return json.RawMessage(j).MarshalJSON()
    }
    
    type ExampleStruct struct {
    	Name string
    	Val  string
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  7. tests/table_test.go

    package tests_test
    
    import (
    	"regexp"
    	"sync"
    	"testing"
    
    	"gorm.io/driver/postgres"
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    	. "gorm.io/gorm/utils/tests"
    )
    
    type UserWithTable struct {
    	gorm.Model
    	Name string
    }
    
    func (UserWithTable) TableName() string {
    	return "gorm.user"
    }
    
    func TestTable(t *testing.T) {
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  8. tests/migrate_test.go

    package tests_test
    
    import (
    	"context"
    	"database/sql"
    	"fmt"
    	"math/rand"
    	"os"
    	"reflect"
    	"strconv"
    	"strings"
    	"testing"
    	"time"
    
    	"github.com/stretchr/testify/assert"
    	"gorm.io/driver/postgres"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/logger"
    	"gorm.io/gorm/migrator"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestMigrate(t *testing.T) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  9. 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 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  10. utils/utils_test.go

    		{"error not equal", errors.New("1"), errors.New("2"), false},
    		{"driver.Valuer equal", ModifyAt{Time: now, Valid: true}, ModifyAt{Time: now, Valid: true}, true},
    		{"driver.Valuer not equal", ModifyAt{Time: now, Valid: true}, ModifyAt{Time: now.Add(time.Second), Valid: true}, false},
    		{"driver.Valuer equal (ptr to nil ptr)", (*ModifyAt)(nil), &ModifyAt{}, false},
    	}
    	for _, test := range assertEqualTests {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top