aboutsummaryrefslogtreecommitdiff
path: root/lib/file_handler/state.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/file_handler/state.ml')
-rw-r--r--lib/file_handler/state.ml17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/file_handler/state.ml b/lib/file_handler/state.ml
index 5b43aff..7cf57da 100644
--- a/lib/file_handler/state.ml
+++ b/lib/file_handler/state.ml
@@ -18,7 +18,7 @@ type insert_result = {
type ('a, 'b) mapper = {
get_row : 'b -> 'a Array.t;
- get_value : 'a -> ImportCSV.DataType.t;
+ get_value : 'a -> ImportDataTypes.Value.t;
default : 'a;
}
@@ -105,14 +105,15 @@ let insert_row :
sheet = state.sheet_number;
row = state.row_number;
target = None;
- value = CSV.DataType.Content (String.concat ~sep:", " []);
+ value = ImportDataTypes.Value.Content (String.concat ~sep:", " []);
exn = e;
})
execution
-(** Load the row with all the informations associated with this sheet.
+(** Load the row with all the informations associated with this sheet.
- If an error has already been raised during the sheet, ignore this row only. *)
+ If an error has already been raised during the sheet, ignore this row only.
+*)
let run_row :
log_error:ImportErrors.t ->
mapper:(_, 'row) mapper ->
@@ -147,20 +148,20 @@ let clear :
log_error:ImportErrors.t ->
'a ImportSQL.Db.t ->
A.t ->
- ImportConf.Syntax.t ->
+ ImporterSyntax.t ->
unit ImportSQL.Db.result =
fun ~log_error db mapping conf ->
ImportSQL.Db.clear_duplicates db (A.table mapping) (A.keys mapping)
~f:(fun values ->
let line =
match snd @@ Array.get values 0 with
- | ImportCSV.DataType.Integer i -> i
+ | ImportDataTypes.Value.Integer i -> i
| _ -> -1
and value = snd @@ Array.get values 1
and target =
match snd @@ Array.get values 2 with
- | ImportCSV.DataType.Content s ->
- Some (ImportConf.get_table_for_name conf (Some s))
+ | ImportDataTypes.Value.Content s ->
+ Some (ImporterSyntax.get_table_for_name conf (Some s))
| _ -> None
in
let error =