db

package
v0.0.0-...-dd85d24 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(itemId, collectionName string) error

func DeleteMany

func DeleteMany(itemIds []string, collectionName string) error

func Insert

func Insert[T any](value Document[T], collectionName string) (any, error)

func InsertMany

func InsertMany[T any](values []Document[T], collectionName string) ([]any, error)

func SetConfig

func SetConfig(config DBConfig)

func Update

func Update[T any](itemId, collectionName string, newValue Document[T]) error

func UpdateMany

func UpdateMany[T any](ids []string, newValues []Document[T], collectionName string) error

Types

type DBConfig

type DBConfig struct {
	Type             DBType
	ConnectionString string
	DBName           string
}

type DBProvider

type DBProvider int32
const (
	Azure DBProvider = iota
)

func (DBProvider) String

func (p DBProvider) String() string

type DBType

type DBType int32
const (
	Mongo DBType = iota
)

func (DBType) String

func (t DBType) String() string

type Document

type Document[T any] struct {
	// contains filtered or unexported fields
}

func Query

func Query[F, T any](filter Filter[F], tableName string) ([]Document[T], error)

type Filter

type Filter[F any] struct{}

Jump to

Keyboard shortcuts

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