From cf0fffed43d0ca7618cd0013411151e057b7a32a Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Mon, 18 May 2026 12:35:26 -0300 Subject: RNT interface Co-authored-by: Estevan Castilho --- lib/qualified_name.mli | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'lib/qualified_name.mli') diff --git a/lib/qualified_name.mli b/lib/qualified_name.mli index 5da7555..196dfbd 100644 --- a/lib/qualified_name.mli +++ b/lib/qualified_name.mli @@ -1,20 +1,18 @@ -(** Fully qualified relation name: [multigroup:schema:relation]. +(** Fully qualified relation reference: [mg:rel_name]. - Unqualified names fill in defaults: empty multigroup, ["public"] schema. *) + The first colon separates the multigroup name from the relation name; any + further colons are part of the relation name verbatim. *) -type t = { multigroup : string; schema : string; relation : string } +type t = { mg : string; name : string } -val default_schema : string +exception Unqualified of 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" *) +(** Splits on the first [:]. Raises [Unqualified] when no mg segment is + present (i.e. no colon, or empty mg / empty name). *) -val make : ?multigroup:string -> ?schema:string -> string -> t -val to_string : t -> string +val try_parse : string -> (t, string) result + +val make : mg:string -> name:string -> t -val to_key : t -> string -(** Composite key for [RelationMap] lookup within a single database: - ["schema:relation"]. *) +val to_string : t -> string -- cgit v1.2.3