aboutsummaryrefslogtreecommitdiffstats
path: root/lib/qualified_name.mli
blob: 5da755506bad729dd12a1da58bd0c01496b99990 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(** Fully qualified relation name: [multigroup:schema:relation].

    Unqualified names fill in defaults: empty multigroup, ["public"] schema. *)

type t = { multigroup : string; schema : string; relation : string }

val default_schema : string

val parse : string -> t
(** Split on [:] with default filling.
    - ["rel"] -> multigroup="", schema="public", relation="rel"
    - ["s:rel"] -> multigroup="", schema="s", relation="rel"
    - ["mg:s:rel"] -> multigroup="mg", schema="s", relation="rel" *)

val make : ?multigroup:string -> ?schema:string -> string -> t
val to_string : t -> string

val to_key : t -> string
(** Composite key for [RelationMap] lookup within a single database:
    ["schema:relation"]. *)