postgresql

package
v0.0.0-...-2a74b1a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: GPL-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCursor = errors.New("invalid cursor")
)

Functions

func NewConnection

func NewConnection(config Config) (*sql.DB, error)

Types

type BarangayStore

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

func NewBarangayStore

func NewBarangayStore(db *sql.DB) *BarangayStore

func (BarangayStore) Find

func (store BarangayStore) Find(id int) (models.Barangay, error)

func (BarangayStore) FindByCode

func (store BarangayStore) FindByCode(code string) (models.Barangay, error)

func (BarangayStore) FindByName

func (store BarangayStore) FindByName(name string) (models.Barangay, error)

func (BarangayStore) List

func (BarangayStore) ListByCityCode

func (store BarangayStore) ListByCityCode(code string, opts stores.SearchOpts) (stores.Collection[models.Barangay], error)

func (BarangayStore) ListByMunicipalityCode

func (store BarangayStore) ListByMunicipalityCode(code string, opts stores.SearchOpts) (stores.Collection[models.Barangay], error)

func (BarangayStore) ListBySpecialGovernmentUnitCode

func (store BarangayStore) ListBySpecialGovernmentUnitCode(code string, opts stores.SearchOpts) (stores.Collection[models.Barangay], error)

func (BarangayStore) ListBySubMunicipalityCode

func (store BarangayStore) ListBySubMunicipalityCode(code string, opts stores.SearchOpts) (stores.Collection[models.Barangay], error)

func (BarangayStore) Save

func (store BarangayStore) Save(ctx context.Context, barangay models.Barangay) error

type CityStore

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

func NewCityStore

func NewCityStore(db *sql.DB) *CityStore

func (CityStore) Find

func (store CityStore) Find(id int) (models.City, error)

func (CityStore) FindByCode

func (store CityStore) FindByCode(code string) (models.City, error)

func (CityStore) FindByName

func (store CityStore) FindByName(name string) (models.City, error)

func (CityStore) List

func (CityStore) ListByDistrictCode

func (store CityStore) ListByDistrictCode(code string, opts stores.SearchOpts) (stores.Collection[models.City], error)

func (CityStore) ListByProvinceCode

func (store CityStore) ListByProvinceCode(code string, opts stores.SearchOpts) (stores.Collection[models.City], error)

func (CityStore) Save

func (store CityStore) Save(ctx context.Context, city models.City) error

type Config

type Config struct {
	Host         string
	Port         int
	User         string
	Password     string
	DatabaseName string
}

type DistrictStore

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

func NewDistrictStore

func NewDistrictStore(connection *sql.DB) *DistrictStore

func (DistrictStore) Find

func (store DistrictStore) Find(id int) (models.District, error)

func (DistrictStore) FindByCode

func (store DistrictStore) FindByCode(code string) (models.District, error)

func (DistrictStore) FindByName

func (store DistrictStore) FindByName(name string) (models.District, error)

func (DistrictStore) List

func (DistrictStore) ListByRegionCode

func (store DistrictStore) ListByRegionCode(code string, opts stores.SearchOpts) (stores.Collection[models.District], error)

func (DistrictStore) Save

func (store DistrictStore) Save(ctx context.Context, district models.District) error

type MunicipalityStore

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

func NewMunicipalityStore

func NewMunicipalityStore(connection *sql.DB) *MunicipalityStore

func (MunicipalityStore) Find

func (store MunicipalityStore) Find(id int) (models.Municipality, error)

func (MunicipalityStore) FindByCode

func (store MunicipalityStore) FindByCode(code string) (models.Municipality, error)

func (MunicipalityStore) FindByName

func (store MunicipalityStore) FindByName(name string) (models.Municipality, error)

func (MunicipalityStore) List

func (MunicipalityStore) ListByDistrictCode

func (store MunicipalityStore) ListByDistrictCode(code string, opts stores.SearchOpts) (stores.Collection[models.Municipality], error)

func (MunicipalityStore) ListByProvinceCode

func (store MunicipalityStore) ListByProvinceCode(code string, opts stores.SearchOpts) (stores.Collection[models.Municipality], error)

func (MunicipalityStore) Save

func (store MunicipalityStore) Save(ctx context.Context, municipality models.Municipality) error

type ProvinceStore

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

func NewProvinceStore

func NewProvinceStore(connection *sql.DB) *ProvinceStore

func (ProvinceStore) Find

func (store ProvinceStore) Find(id int) (models.Province, error)

func (ProvinceStore) FindByCode

func (store ProvinceStore) FindByCode(ctx context.Context, code string) (models.Province, error)

func (ProvinceStore) FindByName

func (store ProvinceStore) FindByName(ctx context.Context, name string) (models.Province, error)

func (ProvinceStore) List

func (ProvinceStore) ListByRegionCode

func (store ProvinceStore) ListByRegionCode(code string, opts stores.SearchOpts) (stores.Collection[models.Province], error)

func (ProvinceStore) Save

func (store ProvinceStore) Save(ctx context.Context, province models.Province) error

type RegionStore

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

func NewRegionStore

func NewRegionStore(connection *sql.DB) *RegionStore

func (RegionStore) Find

func (store RegionStore) Find(id int) (models.Region, error)

func (RegionStore) FindByCode

func (store RegionStore) FindByCode(code string) (models.Region, error)

func (RegionStore) FindByName

func (store RegionStore) FindByName(name string) (models.Region, error)

func (RegionStore) List

func (RegionStore) Save

func (store RegionStore) Save(ctx context.Context, region models.Region) error

type SpecialGovernmentUnit

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

func NewSpecialGovernmentUnit

func NewSpecialGovernmentUnit(db *sql.DB) *SpecialGovernmentUnit

func (SpecialGovernmentUnit) Find

func (SpecialGovernmentUnit) FindByCode

func (SpecialGovernmentUnit) FindByName

func (SpecialGovernmentUnit) List

func (SpecialGovernmentUnit) ListByProvinceCode

func (SpecialGovernmentUnit) Save

type SubMunicipalityStore

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

func NewSubMunicipalityStore

func NewSubMunicipalityStore(db *sql.DB) *SubMunicipalityStore

func (SubMunicipalityStore) Find

func (SubMunicipalityStore) FindByCode

func (store SubMunicipalityStore) FindByCode(code string) (models.SubMunicipality, error)

func (SubMunicipalityStore) FindByName

func (store SubMunicipalityStore) FindByName(name string) (models.SubMunicipality, error)

func (SubMunicipalityStore) List

func (SubMunicipalityStore) ListByCityCode

func (SubMunicipalityStore) Save

func (store SubMunicipalityStore) Save(ctx context.Context, subMunicipality models.SubMunicipality) error

Jump to

Keyboard shortcuts

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