database

package
v0.0.0-...-b616d32 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *sql.DB
}

func Init

func Init(host string, port int, user string, password string, dbname string) (*Database, error)

func (*Database) Close

func (database *Database) Close() error

func (*Database) CreateRepoTable

func (db *Database) CreateRepoTable(dbname string) error

func (*Database) DeleteRepoByID

func (db *Database) DeleteRepoByID(id int64) error

func (*Database) GetAllRepos

func (db *Database) GetAllRepos() ([]*Repository, error)

func (*Database) GetRepoByID

func (db *Database) GetRepoByID(id int64) (*Repository, error)

func (*Database) UpsertRepo

func (db *Database) UpsertRepo(r *Repository) error

UpsertRepo updates or inserts a new repository entry in the database.

type Repository

type Repository struct {
	Id          int64
	Name        string
	Url         string
	Description sql.NullString
	Language    sql.NullString
	Stars       sql.NullString
}

Jump to

Keyboard shortcuts

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