postgresql

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInsertErr

func ParseInsertErr(err error) error

ParseInsertErr is a function to decide common sql error bassed on posible error when sql perform insert query

func ParseReadErr

func ParseReadErr(err error) error

ParseReadErr is a function to decide common sql error bassed on posible error when sql perform select query

Types

type Queries

type Queries zosql.Queries

Queries is extended type of database/Queries

func New

func New() *Queries

New is function to initialize progresql

func (*Queries) Account

func (qry *Queries) Account(ctx context.Context, id string) (*models.AccountInfo, error)

Account is a repo to pull all account data by its username

func (*Queries) Auth

func (qry *Queries) Auth(ctx context.Context, username string) (*models.Auth, error)

Auth is a repo to pull all auth data by its username

func (*Queries) BeginTX

BeginTX is a function to start transaction

func (*Queries) Contacts

func (qry *Queries) Contacts(ctx context.Context, authID string, types ...string) ([]*models.Contact, error)

Contacts is a repo to get user contacts

func (*Queries) CreateAccountInfo

func (qry *Queries) CreateAccountInfo(ctx context.Context, id, name string) (*models.AccountInfo, error)

CreateAccountInfo is a function to insert data into table account_nfo

func (*Queries) CreateAuth

func (qry *Queries) CreateAuth(ctx context.Context, username, passphrase string) (*models.Auth, error)

CreateAuth is a function to insert data into table auth

func (*Queries) CreateContact

func (qry *Queries) CreateContact(ctx context.Context, contact *models.Contact) error

CreateContact is a repo to insert contact data

func (*Queries) DeleteContact

func (qry *Queries) DeleteContact(ctx context.Context, authID, contact string) error

DeleteContact is repo to delete user contact

func (*Queries) OpenConn

func (qry *Queries) OpenConn() (*sql.DB, error)

OpenConn is a function to open database connection pool

func (*Queries) SetPrimaryContact

func (qry *Queries) SetPrimaryContact(ctx context.Context, authID, contact string) error

SetPrimaryContact is a repo to update user primary contact

Jump to

Keyboard shortcuts

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