examples

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Code generated by slice-converter; DO NOT EDIT. See github.com/bombsimon/gorm-bulk

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MyTypePtrSliceToInterfaceSlice

func MyTypePtrSliceToInterfaceSlice(ts []*MyType) []interface{}

MyTypePtrSliceToInterfaceSlice returns an interface slice with MyTypes.

func MyTypeSliceToInterfaceSlice

func MyTypeSliceToInterfaceSlice(ts []MyType) []interface{}

MyTypeSliceToInterfaceSlice returns an interface slice with MyTypes.

func UpdateCustomFunc

func UpdateCustomFunc(db *gorm.DB, myTypes []MyType) error

UpdateCustomFunc runs a bulk update on all passed MyType and will format the SQL according to the myExecFunc changes.

func UpdateMany

func UpdateMany(db *gorm.DB, myTypes []MyType) error

UpdateMany takes a slice of multiple MyType and will perform one single insert with all the elements as values.

Types

type MyType

type MyType struct {
	Field1 string `gorm:"type:varchar(10); unique"`
	Field2 int    `gorm:"type:int(3)"`
}

MyType represents some kind of database model. This struct has a tag set to support automatic code generation to convert []MyType to []interface{}. TYPE-TO-INTERFACE

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL