db

package
v0.0.0-...-822dfe5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(db string) *sql.DB

func Insert

func Insert(db *sql.DB, question, answer string)

We are passing db reference connection from main to our method with other parameters

func Remove

func Remove(db string)

func Update

func Update(db *sql.DB, row *Row)

Types

type Row

type Row struct {
	Id       int
	Question string
	Answer   string
	Correct  int
	Total    int
}

func Get

func Get(db *sql.DB, question string) *Row

func ListTopRows

func ListTopRows(db *sql.DB, n int) []*Row

Jump to

Keyboard shortcuts

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