View Source Csv2sql.TypeDeducer.TypeChecker (Csv2sql v1.0.0)

Type checkers to infer data type of a database column using its preivous inferred type and current item type

Summary

Types

@type csv_col_types_list() :: [{String.t(), String.t()}]
@type db_result_types() :: MyXQL.Result.t() | Postgrex.Result.t()
@type file_status() :: :pending | :analyze | :loading | :done | :failure
@type files_map() :: %{required(String.t()) => File.t()}
Link to this type

supported_db_data_types()

View Source
@type supported_db_data_types() ::
  String.t() | number() | boolean() | Date.t() | DateTime.t() | nil
@type type_map() :: %{
  is_empty: boolean(),
  is_date: boolean(),
  is_datetime: boolean(),
  is_boolean: boolean(),
  is_integer: boolean(),
  is_float: boolean(),
  is_text: boolean(),
  max_data_length: non_neg_integer()
}

Functions

Link to this function

check_type(item, existing_type_map)

View Source
@spec check_type(String.t(), type_map()) :: type_map()