aboutsummaryrefslogtreecommitdiff
path: root/lib/data_types/table.ml
blob: d807c5c6db9259e38f03b4b4031686c21d8bc2e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open StdLabels

type t = {
  file : string;
  tab : int;
  name : string;
}

(** Get the internal name for the given table. 

    This value may differ from the association name given in the configuration. *)
let name : t -> string =
 fun source ->
  let file_name =
    source.file |> Filename.basename |> Filename.remove_extension
  in
  match source.tab with
  | 1 -> file_name
  | _ -> String.concat ~sep:"_" [ file_name; string_of_int source.tab ]