db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: BlueOak-1.0.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct{ *gorm.DB }

DB represents our sqlite3 database file.

func Open

func Open(filename string) (*DB, error)

Open returns a connection to a migrated sqlite3 database file on disk, creating the file and running migrations if necessary.

func (*DB) InsertArtist

func (db *DB) InsertArtist(artist *data.Artist) error

InsertArtist, given an Artist, inserts the appropriate data into the artists, artist_genres, and artists_rtree tables, doing nothing if they already exist.

func (*DB) InsertGenre

func (db *DB) InsertGenre(genre *data.Genre) error

InsertGenre, given a Genre, inserts it into the genres table.

Jump to

Keyboard shortcuts

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