database

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBFields

func DBFields(object interface{}) (string, error)

taken from: https://github.com/jmoiron/sqlx/issues/255 DBFields reflects on a struct and returns the values of fields with `db` tags and returns the keys.

func DBKeyValuePairs

func DBKeyValuePairs(object interface{}) (string, error)

DBValues reflects on a struct and returns the values of fields which have a `db` tag.

func DBPlaceholder

func DBPlaceholder(object interface{}) (string, error)

DBPlaceholder reflects on a struct and returns a placeholder string for every field which have a `db` tag.

func DBPlaceholderForIDs

func DBPlaceholderForIDs(ids []int) string

func DBValues

func DBValues(object interface{}) ([]interface{}, error)

DBValues reflects on a struct and returns the values of fields which have a `db` tag.

func Delete

func Delete(db *sql.DB, table string, objectID int) error

func ExecuteQuery

func ExecuteQuery(db *sql.DB, query string, args []interface{}) (sql.Result, error)

func ExecuteRowQuery

func ExecuteRowQuery(db *sql.DB, query string, args []interface{}) (*sql.Rows, error)

func Insert

func Insert(db *sql.DB, table string, object interface{}) (*sql.Rows, error)

func InterfaceInt

func InterfaceInt(ints []int) []interface{}

func RemoveResource

func RemoveResource(db *sql.DB, object string, objectID int, resource string, resourceID int) error

func Resource

func Resource(db *sql.DB, object string, objectID int, resource string) (*sql.Rows, error)
func Search(db *sql.DB, table string, name string) (*sql.Rows, error)

func Select

func Select(db *sql.DB, table string, objectIDs []int) (*sql.Rows, error)

func SetResource

func SetResource(db *sql.DB, object string, objectID int, resource string, resourceID int) error

func Update

func Update(db *sql.DB, table string, objectID int, object interface{}) (*sql.Rows, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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