Module SkhcDb.ArtistSource

Operation on artists.

Sourcemodule Column : sig ... end

Artist's table columns

Sourcetype t

type of artist

Sourceval init : sort_name:string option -> description:string option -> artwork:string option -> flag:bool -> rating:int option -> string -> t

init ~sort_name ~description ~artwork ~flag ~rating name creates an album at Unix.time () with the id = 0.

Sourceval table_name : string

artist's table name.

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 artist 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 artist 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 artists inside db.

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

update db artist updates db with artist.

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

insert db artist inserts artist inside db.

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

remove_id db id removes artist inside db with the id id.

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

remove db album is remove_id db (id album).

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

find_or_insert db artist tries to find an artist with name name artist. If artist is found, returns the first artist with this name found and true, otherwise returns artist returned by insert and false.

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

find_or_insert db artist tries to find an artist with name name artist. If artist is found, returns the first artist with this name found and true, otherwise returns artist returned by update and false.

Sourceval to_yojson : t -> Yojson.Safe.t
Sourceval id : t -> Int64.t

id artist returns artist's id.

Sourceval name : t -> string

name artist returns artist's name.

Sourceval sort_name : t -> string option

sort_name artist returns artist's sort_name.

Sourceval description : t -> string option

description artist returns artist's description.

Sourceval artwork : t -> string option

artwork artist returns artist's artwork path.

Sourceval flag : t -> bool

flag artist returns if artist's flag is set.

Sourceval rating : t -> int option

rating artist returns artist's rating.

Sourceval created_at : t -> float

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

Sourceval updated_at : t -> float

updated_at artist returns artist'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_description : string option -> t -> t
Sourceval set_artwork : string option -> t -> t
Sourceval set_flag : bool -> t -> t
Sourceval set_rating : int option -> t -> t
Sourceval set_created_at : float -> t -> t
Sourceval set_updated_at : float -> t -> t