database

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const GET_ALL_ARTISTS = "select id, name, default_genre FROM artists;"

Artists

View Source
const GET_ALL_LOCATIONS = `` /* 143-byte string literal not displayed */

Locations

View Source
const GET_ALL_SETS = "select sets.id, user_id, artists.id, artists.name, locations.id, locations.name, sets.date, sets.rating, sets.genre, sets.length, sets.notes " +
	"FROM sets INNER JOIN artists ON artists.id = sets.artist_id " +
	"INNER JOIN locations ON locations.id = sets.location_id;"

Sets

View Source
const GET_ALL_SETS_FOR_USER_FORMAT = "select sets.id, user_id, artists.id, artists.name, locations.id, locations.name, sets.date, sets.rating, sets.genre, sets.length, sets.notes " +
	"FROM sets INNER JOIN artists ON artists.id = sets.artist_id " +
	"INNER JOIN locations ON locations.id = sets.location_id " +
	"WHERE user_id=%d;"
View Source
const GET_ALL_USERS = `select id, username, email, IFNULL(first_name,""), IFNULL(last_name,""), role FROM users;`
View Source
const GET_ARTIST_DEFAULT_GENRE = `select default_genre FROM artists where name = ? or id = ?;`
View Source
const GET_LOCATION_TYPE = `select is_festival FROM locations where id = ?;`
View Source
const GET_SPECIFIC_ARTIST = "select id, name, default_genre FROM artists where id = ?;"
View Source
const GET_SPECIFIC_LOCATION = `` /* 156-byte string literal not displayed */
View Source
const GET_SPECIFIC_USER = `select id, username, email, IFNULL(first_name,""), IFNULL(last_name,""), role FROM users where id = ?;`

Users

View Source
const INSERT_NEW_ARTIST = `insert into artists (name, default_genre) values(?,?);`
View Source
const INSERT_NEW_LOCATION = `insert into locations (name, description, city, state, country, is_festival, year) values(?,?,?,?,?,?,?);`
View Source
const INSERT_NEW_SET = `insert into sets (user_id, artist_id, location_id, date, rating, genre, length, notes) values(?,?,?,?,?,?,?,?);`
View Source
const IS_ARTIST_UNIQUE_QUERY = `select COUNT(*) FROM artists where name = ?`
View Source
const IS_LOCATION_UNIQUE_QUERY = `` /* 133-byte string literal not displayed */
View Source
const IS_LOCATION_UPDATE_UNIQUE = `select COUNT(*) FROM locations where id != ? AND (name = ? AND city = ? AND state = ? AND country = ? AND year = ?)`
View Source
const IS_SET_UNIQUE_QUERY = "select COUNT(*) FROM sets where user_id = ? and artist_id = ? and location_id = ? and date = ?"
View Source
const IS_USER_UPDATE_UNIQUE = `select COUNT(*) FROM users where id != ? AND (username = ? OR email = ?)`
View Source
const UPDATE_LOCATION = `update locations set name = ?, description = ?, city = ?, state = ?, country = ?, is_festival = ?, year = ? WHERE id = ?`
View Source
const UPDATE_USER = `update users set username = ?, email = ?, first_name = ?, last_name = ?, role = ? WHERE id = ?`

Variables

View Source
var DSN = ""

Functions

func GetConnection

func GetConnection() (*sql.DB, error)

func Initialize

func Initialize()

Types

This section is empty.

Jump to

Keyboard shortcuts

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