Module SkhcDb.PlaylistSource

Operation on playlists.

Sourcemodule Stats : sig ... end

Operations on playlist's stats

Sourcemodule Column : sig ... end

Playlist's table columns

Sourcetype t

type of a playlist

Sourceval init : name:string -> query:string -> smart:bool -> flag:bool -> rating:int option -> cover_path:string option -> t

init ~name ~query ~smart ~flag ~cover_path creates a playlist at Unix.time () with id = 0.

Sourceval table_name : string

table name

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

equal p1 p2 tests whether p1 equals p2. All fields are used for the test.

Sourceval compare : t -> t -> int

compare p1 p2 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 all : Database.t -> (t list, Sqlite3.Rc.t * string) result

all db queries all playlists inside db.

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 find_map : Database.t -> (t -> 'a option) -> ('a option, Sqlite3.Rc.t * string) result

find_map db f queries all playlists inside db and applies f to each element, returning the first element being Some.

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

insert db playlist inserts playlist inside db.

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

update db playlist updates db with playlist.

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

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

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

remove_name db name removes playlist inside db with the name name.

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

remove db playlist is remove_id db (id playlist).

Sourceval id : t -> Int64.t

id playlist returns playlist's id.

Sourceval name : t -> string

name playlist returns playlist's name.

Sourceval query : t -> string
Sourceval smart : t -> bool
Sourceval flag : t -> bool
Sourceval rating : t -> int option
Sourceval cover_path : t -> string option
Sourceval created_at : t -> float
Sourceval updated_at : t -> float
Sourceval set_id : Int64.t -> t -> t
Sourceval set_name : string -> t -> t
Sourceval set_flag : bool -> t -> t
Sourceval set_query : string -> t -> t
Sourceval set_rating : int 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