aboutsummaryrefslogtreecommitdiff
path: root/lib/sql/db.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sql/db.ml')
-rw-r--r--lib/sql/db.ml20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/sql/db.ml b/lib/sql/db.ml
index f1aee8c..f2a2653 100644
--- a/lib/sql/db.ml
+++ b/lib/sql/db.ml
@@ -1,6 +1,4 @@
open StdLabels
-module CSV = ImportCSV
-module Syntax = ImportConf.Syntax
module Table = ImportDataTypes.Table
module Path = ImportDataTypes.Path
@@ -153,7 +151,7 @@ let eval_key :
'a t ->
Sqlite3.stmt option ->
ImportAnalyser.Dependency.key list ->
- (int * CSV.DataType.t) list ->
+ (int * ImportDataTypes.Value.t) list ->
(Sqlite3.stmt option * Sqlite3.Data.t list) T.result =
fun db stmt keys values ->
match keys with
@@ -204,7 +202,7 @@ let insert :
Sqlite3.db ->
Sqlite3.stmt ->
id:int ->
- (int * CSV.DataType.t) list ->
+ (int * ImportDataTypes.Value.t) list ->
unit T.result =
fun db statement ~id values ->
let** _ = T.savepoint db "PREVIOUS" in
@@ -255,9 +253,9 @@ let execute_query :
Ok statement
let query :
- f:((Path.t ImportExpression.T.t * CSV.DataType.t) array -> unit) ->
+ f:((Path.t ImportExpression.T.t * ImportDataTypes.Value.t) array -> unit) ->
Sqlite3.db ->
- Syntax.t ->
+ ImporterSyntax.t ->
unit T.result =
fun ~f db output ->
(* Extract the query from the configuration. *)
@@ -280,7 +278,7 @@ let query :
in
Ok ()
-let create_view : Sqlite3.db -> Syntax.t -> unit T.result =
+let create_view : Sqlite3.db -> ImporterSyntax.t -> unit T.result =
fun db output ->
ignore output;
let* drop = Sqlite3.exec db "DROP VIEW IF EXISTS 'result'" in
@@ -300,10 +298,10 @@ let create_view : Sqlite3.db -> Syntax.t -> unit T.result =
*)
let check_foreign :
- f:((string * CSV.DataType.t) array -> unit) ->
+ f:((string * ImportDataTypes.Value.t) array -> unit) ->
Sqlite3.db ->
- Syntax.t ->
- Syntax.Extern.t ->
+ ImporterSyntax.t ->
+ ImporterSyntax.Extern.t ->
unit T.result =
fun ~f db conf external_ ->
let query = ImportAnalyser.Query.check_external conf external_ in
@@ -318,7 +316,7 @@ let check_foreign :
|> T.to_result
let clear_duplicates :
- f:((string * ImportCSV.DataType.t) array -> unit) ->
+ f:((string * ImportDataTypes.Value.t) array -> unit) ->
'a t ->
ImportDataTypes.Table.t ->
ImportAnalyser.Dependency.key list ->