Module Dbf_types.V1


module V1: sig .. end


type t_key =
| Primary_key
| Key
Type of keys.
val xparse_t_key : IoXML.ast -> t_key
val xprint_t_key : Format.formatter -> t_key -> unit
type sql_code = string 
SQL code is a string.
val xparse_sql_code : IoXML.ast -> string
val xprint_sql_code : Format.formatter -> string -> unit

type dbms =
| Odbc
| Mysql
| Postgres
The various supported DBMS.
val xparse_dbms : IoXML.ast -> dbms
val xprint_dbms : Format.formatter -> dbms -> unit

type column_dbms = {
   mutable col_type_sql : string * string option * string option; (*SQL type, an optional argument, and optional args*)
   mutable col_2ml : string; (*Name of the function to call to get a ml value from a string*)
   mutable col_ml2 : string; (*Name of the function to call to get a strign from a ml value*)
   mutable col_key : t_key option; (*optional key type*)
   mutable col_default : sql_code option; (*optional default SQL value*)
   mutable col_atts : (string * sql_code) list; (*list of (attribute name, SQL code for value)*)
}
Column info for a specific dbms.
val xparse_column_dbms : IoXML.ast -> column_dbms
val xprint_column_dbms : Format.formatter -> column_dbms -> unit

type column = {
   mutable col_name : string; (*Name of the column, will also be the name of the record in the ocaml record type of the table*)
   mutable col_comment : string; (*Comment of the column*)
   mutable col_type_ml : string; (*OCaml type to represent the SQL type*)
   mutable col_nullable : bool; (*column can contain NULL values or not*)
   mutable col_index : bool; (*make an index on this column or not*)
   mutable col_dbms : (dbms * column_dbms) list; (*DBMS-specific information*)
}
A table column.
val xparse_column : IoXML.ast -> column
val xprint_column : Format.formatter -> column -> unit

type table = {
   mutable ta_name : string;
   mutable ta_comment : string;
   mutable ta_columns : column list;
   mutable ta_atts : int list; (*later, table attributes*)
   mutable ta_indexes : int list; (*later, indexes on various columns*)
}
A table.
val xparse_table : IoXML.ast -> table
val xprint_table : Format.formatter -> table -> unit

type schema = {
   mutable sch_tables : table list;
}
A schema.
val xparse_schema : IoXML.ast -> schema
val xprint_schema : Format.formatter -> schema -> unit

type att_desc =
| Att_string
To describe attributes.
val xparse_att_desc : IoXML.ast -> att_desc
val xprint_att_desc : Format.formatter -> att_desc -> unit
val default : unit -> schema
val version : string
val read : Pervasives.in_channel -> schema
val write : Pervasives.out_channel -> schema -> unit