Module SkhcDb.AlbumSource

Operation on albums.

Sourcemodule Stats : sig ... end

Operations on album's stats

Sourcemodule Column : sig ... end

Album's table columns

Sourcetype t

type of an album.

Sourceval init : sort_name:string option -> year:int option -> compilation:bool -> flag:bool -> rating:int option -> comment:string option -> genre:string option -> cover_path:string option -> string -> t

init ~sort_name ~year ~compilation ~flag ~rating ~comment ~genre ~cover_path name creates an album at Unix.time () with id = 0.

Sourceval table_name : string

artist's table name.

Sourceval to_yojson : t -> Yojson.Safe.t
Sourceval equal : t -> t -> bool

equal a1 a2 tests whether a1 equals a2. All fields are used for the test.

Sourceval compare : t -> t -> int

compare a1 a2 is Stdlib.compare.

Sourceval to_string : t -> string

to_string t is a string representation of t.

Sourceval pp : Format.formatter -> t -> unit

pp format t is a preety printer for t.

Sourceval find_from_id : Database.t -> int64 -> (t option, Sqlite3.Rc.t * string) result

find_from_id db id tries to find the album inside db with id

  • since 0.3.0
Sourceval filter_map : Database.t -> (t -> 'a option) -> ('a list, Sqlite3.Rc.t * string) result

filter_map db f queries all albums inside db and applies f to every element, keeping all Some elements returned by f.

Sourceval all : Database.t -> (t list, Sqlite3.Rc.t * string) result

all db queries all albums inside db.

Sourceval insert : Database.t -> t -> (t, Sqlite3.Rc.t * string) result

insert db album inserts album inside db.

Sourceval update : Database.t -> t -> (t, Sqlite3.Rc.t * string) result

update db album updates db with album and set updated_at to Unix.time ().

Sourceval remove_id : Database.t -> int64 -> (unit, Sqlite3.Rc.t * string) result
Sourceval remove : Database.t -> t -> (unit, Sqlite3.Rc.t * string) result

remove db album is remove_id db (id album).

Sourceval id : t -> int64

id album returns album's id.

Sourceval name : t -> string

name album returns album's name.

Sourceval sort_name : t -> string option

sort_name album returns album's sort_name.

Sourceval year : t -> int option

year album returns album's year.

Sourceval compilation : t -> bool

compilation album returns if album is a compilation.

Sourceval flag : t -> bool

flag album returns if album's flag is set.

Sourceval rating : t -> int option

rating album returns album's rating.

Sourceval comment : t -> string option

comment album returns album's comment.

Sourceval genre : t -> string option

genre album returns album's genre.

Sourceval cover_path : t -> string option

cover_path album returns album's cover_path.

Sourceval created_at : t -> float

created_at album returns album's created time since unix epoch.

Sourceval updated_at : t -> float

updated_at album returns album's updated time since unix epoch.

Sourceval set_id : int64 -> t -> t
Sourceval set_name : string -> t -> t
Sourceval set_sort_name : string option -> t -> t
Sourceval set_year : int option -> t -> t
Sourceval set_compilation : bool -> t -> t
Sourceval set_flag : bool -> t -> t
Sourceval set_rating : int option -> t -> t
Sourceval set_comment : string option -> t -> t
Sourceval set_genre : string option -> t -> t
Sourceval set_cover_path : string option -> t -> t
Sourceval set_created_at : float -> t -> t
Sourceval set_updated_at : float -> t -> t