dbutils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSchemaTable

func AddSchemaTable(schema string, table string) func(tx *gorm.DB) *gorm.DB

AddSchemaTable Add schema prefix to the queries

func NewPgMultiSchemaStorage

func NewPgMultiSchemaStorage() *pgMultiSchemaStorage

func SplitValue

func SplitValue(data []byte) ([]byte, []byte, error)

SplitValue split the value into key and data

Types

type ItemsDB

type ItemsDB struct {
	WalletId string `gorm:"column:wallet_id;primaryKey"`
	Id       int64  `gorm:"column:id;primaryKey;auto_increment:true"`
	Type     string `gorm:"column:type"`
	Name     string `gorm:"column:name"`
	Value    []byte `gorm:"column:value"`
	Key      []byte `gorm:"column:key"` // NOT USED ACTUALLY
}

func (*ItemsDB) TableName

func (i *ItemsDB) TableName() string

type MetadataDB

type MetadataDB struct {
	WalletId string `gorm:"column:wallet_id;primary_key"`
	Value    string `gorm:"column:value;not null"` // this comes as a base64 encoded json
}

Tables definitions

func (*MetadataDB) TableName

func (m *MetadataDB) TableName() string

type TagsEncryptedDB

type TagsEncryptedDB struct {
	WalletId string `gorm:"column:wallet_id;primaryKey"`
	Name     string `gorm:"column:name;primaryKey"`
	Value    string `gorm:"column:value"`
	ItemId   int64  `gorm:"column:item_id;primaryKey;auto_increment:false;not null"`
}

func (*TagsEncryptedDB) TableName

func (te *TagsEncryptedDB) TableName() string

type TagsPlaintextDB

type TagsPlaintextDB struct {
	WalletId string `gorm:"column:wallet_id;primaryKey"`
	Name     string `gorm:"column:name;primaryKey;not null"`
	Value    string `gorm:"column:value"`
	ItemId   int64  `gorm:"column:item_id;primaryKey;auto_increment:false;not null"`
}

func (*TagsPlaintextDB) TableName

func (tp *TagsPlaintextDB) TableName() string

Jump to

Keyboard shortcuts

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