aboutsummaryrefslogtreecommitdiff
path: root/lib/file_handler
diff options
context:
space:
mode:
Diffstat (limited to 'lib/file_handler')
-rw-r--r--lib/file_handler/dry_run.ml17
-rwxr-xr-xlib/file_handler/dune1
-rw-r--r--lib/file_handler/state.ml4
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/file_handler/dry_run.ml b/lib/file_handler/dry_run.ml
new file mode 100644
index 0000000..ea17a23
--- /dev/null
+++ b/lib/file_handler/dry_run.ml
@@ -0,0 +1,17 @@
+module A = ImportAnalyser.Dependency
+module C = ImportContainers
+module Db = ImportSQL.Db
+
+let importInDatable :
+ log_error:ImportErrors.t ->
+ conf:ImporterSyntax.t ->
+ dirname:string ->
+ A.t ->
+ 'a Db.t ->
+ ImportDataTypes.Value.t array option Lwt.t =
+ fun ~log_error ~conf ~dirname mapping db ->
+ ignore dirname;
+ ignore conf;
+ ignore log_error;
+ ignore @@ Db.create_table db mapping;
+ Lwt.return None
diff --git a/lib/file_handler/dune b/lib/file_handler/dune
index 80b2ff6..6d5def0 100755
--- a/lib/file_handler/dune
+++ b/lib/file_handler/dune
@@ -9,6 +9,7 @@
core
lwt
lwt.unix
+ ppx_deriving.runtime
helpers
importDataTypes
importContainers
diff --git a/lib/file_handler/state.ml b/lib/file_handler/state.ml
index 7cf57da..e073fd3 100644
--- a/lib/file_handler/state.ml
+++ b/lib/file_handler/state.ml
@@ -151,7 +151,9 @@ let clear :
ImporterSyntax.t ->
unit ImportSQL.Db.result =
fun ~log_error db mapping conf ->
- ImportSQL.Db.clear_duplicates db (A.table mapping) (A.keys mapping)
+ let table = A.table mapping in
+ let is_root = ImportDataTypes.Table.equal table conf.source in
+ ImportSQL.Db.clear_duplicates ~is_root db table (A.keys mapping)
~f:(fun values ->
let line =
match snd @@ Array.get values 0 with