Socket
Book a DemoInstallSign in
Socket

vimagination.zapto.org/store

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vimagination.zapto.org/store

Go Modules
Version
v0.0.0-20251006061529-667c96eda170
Version published
Created
Source

store

-- import "vimagination.zapto.org/store"

Package store automatically configures a database to store structured information in an sql database.

Usage

var (
	ErrDBClosed         = errors.New("database already closed")
	ErrNoPointerStruct  = errors.New("given variable is not a pointer to a struct")
	ErrNoKey            = errors.New("could not determine key")
	ErrDuplicateColumn  = errors.New("duplicate column name found")
	ErrUnregisteredType = errors.New("type not registered")
	ErrInvalidType      = errors.New("invalid type")
)

Errors.

type And

type And []Filter

func (And) SQL

func (a And) SQL() string

func (And) Vars

func (a And) Vars() []interface{}

type Filter

type Filter interface {
	SQL() string
	Vars() []interface{}
}

type Or

type Or []Filter

func (Or) SQL

func (o Or) SQL() string

func (Or) Vars

func (o Or) Vars() []interface{}

type PreparedSearch

type PreparedSearch struct {
}

func (*PreparedSearch) Count

func (p *PreparedSearch) Count() (int, error)

func (*PreparedSearch) GetPage

func (p *PreparedSearch) GetPage(is []interface{}, offset int) (int, error)
type Search struct {
	Sort   []SortBy
	Filter Filter
}

func (*Search) Prepare

func (s *Search) Prepare() (*PreparedSearch, error)

type SortBy

type SortBy struct {
	Column string
	Asc    bool
}

type Store

type Store struct {
}

func New

func New(dataSourceName string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Count

func (s *Store) Count(i interface{}) (int, error)

func (*Store) Get

func (s *Store) Get(is ...interface{}) error

func (*Store) GetPage

func (s *Store) GetPage(is []interface{}, offset int) (int, error)

func (*Store) NewSearch

func (s *Store) NewSearch(i interface{}) *Search

func (*Store) Register

func (s *Store) Register(is ...interface{}) error

func (*Store) Remove

func (s *Store) Remove(is ...interface{}) error

func (*Store) Set

func (s *Store) Set(is ...interface{}) error

FAQs

Package last updated on 06 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts