database

package
v0.0.0-...-afdb705 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SQLiteConn

func SQLiteConn() (*gorm.DB, error)

Types

type Store

type Store struct {
	DB *gorm.DB
}

func New

func New() *Store

Create a new Store, which has a connection to a gorm.DB.

func (*Store) Add

func (s *Store) Add(i interface{}, t string) error

Adds a record to THE table

func (*Store) AutoMigrate

func (s *Store) AutoMigrate(i ...interface{}) error

Automatically Migrate all of the given Models

func (*Store) Close

func (s *Store) Close() error

CLOSSESSSS

func (*Store) Contains

func (s *Store) Contains(i interface{}, t string, primary ...interface{}) error

Checks if there is a record

func (*Store) Delete

func (s *Store) Delete(i interface{}, t string, primary ...interface{}) error

Deletes a record FROM THE table

func (*Store) Get

func (s *Store) Get(i interface{}, t string, primary ...interface{}) error

Gets a record from THE table

func (*Store) List

func (s *Store) List(i interface{}, t string, primary ...interface{}) error

Gets ALL the records from table

func (*Store) Ping

func (s *Store) Ping() error

PINGSSSSSSSSSSSSSSSS

func (*Store) Update

func (s *Store) Update(i interface{}, t string) error

Updates a record to THE table

Jump to

Keyboard shortcuts

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