(* TABLES *)
-let sprintf_refObj_format name = sprintf "
+let sprintf_refObj_format name = [sprintf "
CREATE TABLE %s (
source varchar(255) binary not null,
h_occurrence varchar(255) binary not null,
h_position varchar(255) binary not null,
h_depth integer
-);" name
+);" name]
-let sprintf_refSort_format name = sprintf "
+let sprintf_refSort_format name = [sprintf "
CREATE TABLE %s (
source varchar(255) binary not null,
h_position varchar(255) binary not null,
h_depth integer not null,
h_sort varchar(255) binary not null
-);" name
+);" name]
-let sprintf_refRel_format name = sprintf "
+let sprintf_refRel_format name = [sprintf "
CREATE TABLE %s (
source varchar(255) binary not null,
h_position varchar(255) binary not null,
h_depth integer not null
-);" name
+);" name]
-let sprintf_objectName_format name = sprintf "
+let sprintf_objectName_format name = [sprintf "
CREATE TABLE %s (
source varchar(255) binary not null,
value varchar(255) binary not null
-);" name
+);" name]
-let sprintf_owners_format name = sprintf "
+let sprintf_owners_format name = [sprintf "
CREATE TABLE %s (
source varchar(255) binary not null,
owner varchar(255) binary not null
-);" name
+);" name]
-let sprintf_count_format name = sprintf "
+let sprintf_count_format name = [sprintf "
CREATE TABLE %s (
source varchar(255) binary unique not null,
conclusion smallint(6) not null,
hypothesis smallint(6) not null,
statement smallint(6) not null
-);" name
+);" name]
(* INDEXES *)
-let sprintf_refObj_index name = sprintf "
-CREATE INDEX %s_source ON %s (source);
-CREATE INDEX %s_target ON %s (h_occurrence);
-CREATE INDEX %s_position ON %s (h_position);
-" name name name name name name
+let sprintf_refObj_index name = [
+sprintf "CREATE INDEX %s_source ON %s (source);" name name ;
+sprintf "CREATE INDEX %s_target ON %s (h_occurrence);" name name ;
+sprintf "CREATE INDEX %s_position ON %s (h_position);" name name ]
-let sprintf_refSort_index name = sprintf "
+let sprintf_refSort_index name = [sprintf "
CREATE INDEX %s_source ON %s (source);
-" name name
+" name name]
-let sprintf_objectName_index name = sprintf "
-CREATE INDEX %s_value ON %s (value);
-" name name
+let sprintf_objectName_index name = [
+sprintf " CREATE INDEX %s_value ON %s (value);" name name]
-let sprintf_owners_index name = sprintf "
-CREATE INDEX %s_owner ON %s (owner);
-CREATE INDEX %s_source ON %s (source);
-" name name name name
+let sprintf_owners_index name = [
+sprintf "CREATE INDEX %s_owner ON %s (owner);" name name ;
+sprintf "CREATE INDEX %s_source ON %s (source);" name name]
-let sprintf_count_index name = sprintf "
-CREATE INDEX %s_source ON %s (source);
-CREATE INDEX %s_conclusion ON %s (conclusion);
-CREATE INDEX %s_hypothesis ON %s (hypothesis);
-CREATE INDEX %s_statement ON %s (statement);
-" name name name name name name name name
+let sprintf_count_index name = [
+sprintf "CREATE INDEX %s_source ON %s (source);" name name;
+sprintf "CREATE INDEX %s_conclusion ON %s (conclusion);" name name;
+sprintf "CREATE INDEX %s_hypothesis ON %s (hypothesis);" name name;
+sprintf "CREATE INDEX %s_statement ON %s (statement);" name name]
+
-let sprintf_refRel_index name = ""
+let sprintf_refRel_index name = []
(* FUNCTIONS *)
| `Count -> sprintf_count_index named
let create_tables l =
- List.fold_left (fun s (name,table) -> s ^ get_table_format table name) "" l
+ List.fold_left (fun s (name,table) -> s @ get_table_format table name) [] l
let create_indexes l =
- List.fold_left (fun s (name,table) -> s ^ get_index_format table name) "" l
+ List.fold_left (fun s (name,table) -> s @ get_index_format table name) [] l