postgres

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializePostgresClient

func InitializePostgresClient() (pb.PostgresClient, error)

Types

type Database

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

func NewDatabase

func NewDatabase(ctx context.Context, client pb.PostgresClient) Database

func (Database) DeleteOne

func (d Database) DeleteOne(filter ...interface{}) error

func (Database) Exec

func (d Database) Exec(query string, args ...interface{}) (sql.Result, error)

func (Database) FindMany

func (d Database) FindMany(documents interface{}, filter interface{}) error

func (Database) FindOne

func (d Database) FindOne(document interface{}, filter ...interface{}) (bool, error)

func (Database) ID

func (d Database) ID(id string) isql.Database

func (Database) InsertMany

func (d Database) InsertMany(documents []interface{}) ([]string, error)

TODO: Implement in a more efficient way

func (Database) InsertOne

func (d Database) InsertOne(document interface{}) (id string, err error)

func (Database) Query

func (d Database) Query(query string, args ...interface{}) (*sql.Rows, error)

func (Database) Table

func (d Database) Table(name string) isql.Database

func (Database) UpdateOne

func (d Database) UpdateOne(document interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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