v1.0.2 Albums

main 1.0.2
parent 60128ac058
commit dc1e2fa5bb

@ -21,25 +21,30 @@ func Connect() (*Sea, error) {
return &sea, nil return &sea, nil
} }
func openDB() (*sqlx.DB, error) {
db, err := sqlx.Open("mysql", "itman:X753951x@(xigmanas:3306)/sea")
if err != nil {
return nil, err
}
return db, nil
}
// ============= ALBUM ============ // ============= ALBUM ============
type Album struct { type Album struct {
Seria string Seria string
Cnt int Cnt int
Hash string Hash string
} }
// func getAlbums(db *sqlx.DB) []Album { func (s *Sea) Albums(db *sqlx.DB) ([]Album, error) {
// cmd := "call getAlbums()" cmd := "call getAlbums()"
// var albums []Album var albums []Album
// err := db.Select(&albums, cmd) err := db.Select(&albums, cmd)
// return albums
// }
func openDB() (*sqlx.DB, error) {
db, err := sqlx.Open("mysql", "itman:X753951x@(xigmanas:3306)/sea")
if err != nil { if err != nil {
return nil, err return nil, err
} }
return db, nil return albums, nil
} }

Loading…
Cancel
Save