Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for ColumnTypes (0.17 sec)

  1. scan.go

    	)
    
    	db.RowsAffected = 0
    
    	switch dest := db.Statement.Dest.(type) {
    	case map[string]interface{}, *map[string]interface{}:
    		if initialized || rows.Next() {
    			columnTypes, _ := rows.ColumnTypes()
    			prepareValues(values, db, columnTypes, columns)
    
    			db.RowsAffected++
    			db.AddError(rows.Scan(values...))
    
    			mapValue, ok := dest.(map[string]interface{})
    			if !ok {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Mar 15 06:14:48 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  2. tests/migrate_test.go

    		t.Fatalf("no error should happened when auto migrate column, but got %v", err)
    	}
    
    	if columnTypes, err := DB.Migrator().ColumnTypes(&ColumnStruct{}); err != nil {
    		t.Fatalf("no error should returns for ColumnTypes")
    	} else {
    		stmt := &gorm.Statement{DB: DB}
    		stmt.Parse(&ColumnStruct2{})
    
    		for _, columnType := range columnTypes {
    			switch columnType.Name() {
    			case "id":
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  3. migrator/migrator.go

    		}
    		if !unique && field.Unique {
    			return m.DB.Migrator().CreateConstraint(value, constraint)
    		}
    		return nil
    	})
    }
    
    // ColumnTypes return columnTypes []gorm.ColumnType and execErr error
    func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error) {
    	columnTypes := make([]gorm.ColumnType, 0)
    	execErr := m.RunWithValue(value, func(stmt *gorm.Statement) (err error) {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 28.5K bytes
    - Viewed (0)
  4. interfaces.go

    }
    
    // GetDBConnector SQL db connector
    type GetDBConnector interface {
    	GetDBConn() (*sql.DB, error)
    }
    
    // Rows rows interface
    type Rows interface {
    	Columns() ([]string, error)
    	ColumnTypes() ([]*sql.ColumnType, error)
    	Next() bool
    	Scan(dest ...interface{}) error
    	Err() error
    	Close() error
    }
    
    type ErrorTranslator interface {
    	Translate(err error) 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)
  5. migrator.go

    	MigrateColumnUnique(dst interface{}, field *schema.Field, columnType ColumnType) error
    	HasColumn(dst interface{}, field string) bool
    	RenameColumn(dst interface{}, oldName, field string) error
    	ColumnTypes(dst interface{}) ([]ColumnType, error)
    
    	// Views
    	CreateView(name string, option ViewOption) error
    	DropView(name string) error
    
    	// Constraints
    	CreateConstraint(dst interface{}, name string) error
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  6. tests/postgres_test.go

        INCREMENT BY 1
        NO MINVALUE
        NO MAXVALUE
        CACHE 1
    );
    	`).Error; err != nil {
    		t.Fatalf("failed to create table, got error %v", err)
    	}
    
    	columns, err := DB.Migrator().ColumnTypes("log_usage")
    	if err != nil {
    		t.Fatalf("failed to get columns, got error %v", err)
    	}
    
    	hasLogID := false
    	for _, column := range columns {
    		if column.Name() == "log_id" {
    			hasLogID = true
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  7. api/go1.8.txt

    pkg database/sql, method (*DB) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
    pkg database/sql, method (*DB) QueryRowContext(context.Context, string, ...interface{}) *Row
    pkg database/sql, method (*Rows) ColumnTypes() ([]*ColumnType, error)
    pkg database/sql, method (*Rows) NextResultSet() bool
    pkg database/sql, method (*Stmt) ExecContext(context.Context, ...interface{}) (Result, error)
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Dec 21 05:25:57 GMT 2016
    - 16.3K bytes
    - Viewed (0)
Back to top