let convert_column table dbms col =
let cdbms = List.assoc dbms col.col_dbms in
let ty,spec_tys = sqltype_of_col dbms cdbms in
let c = SQL_db.insert_column table
~name: col.col_name
~comment: col.col_comment
~ty
~nullable: col.col_nullable
()
in
c.SQL_db.col_ocaml_ty <- col.col_type_ml;
c.SQL_db.col_sql2ml <- cdbms.col_2ml;
c.SQL_db.col_ml2sql <- cdbms.col_ml2;
c.SQL_db.col_spec_ty <- spec_tys ;
let spec_options =
let empty = Dbf_misc.StringMap.empty in
match cdbms.col_type_sql with
(_,_,None) -> empty
| (_,_,Some s) ->
let db = string_of_dbms dbms in
Dbf_misc.StringMap.add db [s] empty
in
c.SQL_db.col_spec_options <- spec_options