diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2024-03-14 08:26:58 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2024-03-14 08:26:58 +0100 |
commit | 6b377719c10d5ab3343fd5221f99a4a21008e25a (patch) | |
tree | a7c1e9a820d339a2f161af3e09cf9e3161286796 /lib/data_types/table.ml |
Initial commitmain
Diffstat (limited to 'lib/data_types/table.ml')
-rw-r--r-- | lib/data_types/table.ml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/data_types/table.ml b/lib/data_types/table.ml new file mode 100644 index 0000000..d807c5c --- /dev/null +++ b/lib/data_types/table.ml @@ -0,0 +1,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 ] |