sifdb

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 6 Imported by: 0

README

sifdb

SQLite Database Wrapper for Golang using https://github.com/mattn/go-sqlite3 package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(table interface{}, db *sql.DB) error

func Delete

func Delete(database_struct interface{}, db *sql.DB) error

func Get

func Get(database_struct interface{}, db *sql.DB) ([]string, error)

func Insert

func Insert(database_struct interface{}, db *sql.DB) error

func Open

func Open(databasefile string) *sql.DB

Initiates a new table in the database. The table should be a struct with json tags to be able to easily unmarshal the content later. Example struct to give as table:

type User struct {
	id        int     `json:"id"` -- mandatory field to have in every struct
	username  string  `json:"username"`
	password  string  `json:"password"`
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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