postgresCRUD

package
v0.0.0-...-646b7d3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseClient

func CloseClient()

CloseClient not only closes the client and allows you to get a new one with GetClient().

func ColumnNameDecode

func ColumnNameDecode(name string) string

func ColumnNameEncode

func ColumnNameEncode(name string) string

func Create

func Create(queryable common.Queryable) error

func CreateTableIfNotExists

func CreateTableIfNotExists(queryable common.Queryable) error

func Delete

func Delete(firestoreID string, collectionName string) error

func GetClient

func GetClient() (*sqlx.DB, error)

GetClient for postgres.

func Read

func Read(q common.Queryable) error

func Update

func Update(queryable common.Queryable) error

Types

type Query

type Query struct {
	Collection string
	WHERE      string
}

func (*Query) AddArrayContains

func (q *Query) AddArrayContains(k string, v string) error

func (*Query) AddEquals

func (q *Query) AddEquals(k string, v string)

func (*Query) AddFullTextSearch

func (q *Query) AddFullTextSearch(v string, keys ...string) error

TODO consider adding an index on fields which we use a FullTextSearch query on. https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX

func (*Query) Init

func (q *Query) Init(industryID string, domainID string, schemaID string, firestoreCollection string)

func (*Query) QueryRead

func (q *Query) QueryRead() (common.Iter, error)

type RowIter

type RowIter struct {
	Collection string
	Rows       *sqlx.Rows
}

func (RowIter) Length

func (r RowIter) Length() int

Length always returns -1 because we do not know how long the query result is prior to reading all results.

func (RowIter) Next

func (r RowIter) Next() (common.Queryable, error)

func (RowIter) Stop

func (r RowIter) Stop()

Jump to

Keyboard shortcuts

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