common

package
v1.3.97 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbDecode

func DbDecode(propertyType model.ResourceProperty_Type, val interface{}) (interface{}, error)

func NewSqlBackend

func NewSqlBackend(dataSource abs.DataSource, options SqlBackendOptions) abs.Backend

Types

type CustomType

type CustomType struct {
	CustomEquals  func(a, b interface{}) bool
	CustomPack    func(value interface{}) (*structpb.Value, error)
	CustomUnPack  func(val *structpb.Value) (interface{}, error)
	CustomDefault func() any
	CustomPointer func(required bool) any
	CustomString  func(val any) string
	CustomIsEmpty func(value any) bool
}

func CustomTypeFromType

func CustomTypeFromType(typ types.PropertyType, override CustomType) CustomType

func (CustomType) Default

func (u CustomType) Default() any

func (CustomType) Equals

func (u CustomType) Equals(a, b interface{}) bool

func (CustomType) IsEmpty

func (u CustomType) IsEmpty(value any) bool

func (CustomType) Pack

func (u CustomType) Pack(val interface{}) (*structpb.Value, error)

func (CustomType) Pointer

func (u CustomType) Pointer(required bool) any

func (CustomType) String

func (u CustomType) String(val any) string

func (CustomType) UnPack

func (u CustomType) UnPack(val *structpb.Value) (interface{}, error)

type SqlBackendOptions

type SqlBackendOptions interface {
	UseDbHandleError(func(ctx context.Context, err error) error)
	GetConnectionString() string
	GetSql(s string) string
	GetDriverName() string
	HandleError(err error) (error, bool)
	GetSqlTypeFromProperty(propertyType model.ResourceProperty_Type, length uint32) string
	GetPropertyTypeFromPsql(columnType string) model.ResourceProperty_Type
	Quote(str string) string
	GetFlavor() sqlbuilder.Flavor
	GetDefaultCatalog() string
	GetResourceMigrationBuilderConstructor() helper.ResourceMigrationBuilderConstructor
	GetFullTableName(config *model.ResourceSourceConfig) string
	DbEncode(property *model.ResourceProperty, packedVal *structpb.Value) (interface{}, error)
	TypeModifier(propertyType model.ResourceProperty_Type) types.PropertyType
}

Jump to

Keyboard shortcuts

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