sqlTools

package
v0.0.0-...-37c8998 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetColumnsAndValuesFromStruct

func GetColumnsAndValuesFromStruct(ctx context.Context, st interface{}, callOpts ...CallOptionMapValues) ([]string, []interface{})

func GetMapValuesFromStruct

func GetMapValuesFromStruct(ctx context.Context, st interface{}, callOpts ...CallOptionMapValues) map[string]interface{}

GetMapValuesFromStruct For INSERT or UPDATE queries

func NewMock

func NewMock() (*sql.DB, sqlmock.Sqlmock)

func NewPSQLStatementBuilder

func NewPSQLStatementBuilder(db *sqlx.DB) squirrel.StatementBuilderType

func ParseColumnsForSelect

func ParseColumnsForSelect(cols []string) []string

func ParseColumnsForSelectWithAlias

func ParseColumnsForSelectWithAlias(cols []string, alias string) []string

Types

type CallOptionMapValues

type CallOptionMapValues struct {
	// contains filtered or unexported fields
}

func WithMapValuesAutoDateTimeFields

func WithMapValuesAutoDateTimeFields(fields []string) CallOptionMapValues

func WithMapValuesIgnoreFields

func WithMapValuesIgnoreFields(fields []string) CallOptionMapValues

func WithMapValuesSelectFields

func WithMapValuesSelectFields(fields []string) CallOptionMapValues

type CommonRepository

type CommonRepository interface {
	Close()
}

type SqlxTransaction

type SqlxTransaction struct {
	// contains filtered or unexported fields
}

func NewSqlxTransaction

func NewSqlxTransaction(mdbi *datastore.MasterDbInstance) *SqlxTransaction

func (SqlxTransaction) Init

func (s SqlxTransaction) Init() (tx *sqlx.Tx, err error)

Jump to

Keyboard shortcuts

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