View Source Csv2sql.Database behaviour (Csv2sql v1.0.0)
Database specific functions
Summary
Types
@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()}
@type supported_db_data_types() :: String.t() | number() | boolean() | Date.t() | DateTime.t() | nil
Callbacks
@callback db_name() :: String.t()
@callback delimiter() :: <<_::8>>
@callback encode(String.t(), String.t()) :: supported_db_data_types()
@callback get_ordering_column_type() :: String.t()
Functions
@spec get_create_table_ddl(String.t(), String.t(), csv_col_types_list()) :: String.t()
@spec get_db_name() :: String.t()
@spec get_repo(:mysql | :postgres | String.t()) :: Csv2sql.MySQLRepo | Csv2sql.PostgresRepo
@spec insert_data_chunk(Csv2sql.File.t(), list()) :: :ok
@spec run_query!(String.t()) :: db_result_types()
@spec run_query!(atom(), String.t()) :: db_result_types()
@spec varchar_limit() :: pos_integer()