Voile.Migration.DataSource (Voile v0.1.26)

Copy Markdown View Source

Abstraction layer for data sources (CSV files or MySQL database).

This module provides a unified interface for reading data from either CSV files in the scripts/csv_data directory or directly from a MySQL SLiMS database.

Summary

Functions

Close data source connection.

Fetch data of specified type from the configured source. Returns a stream of data rows.

Get data count for specified type.

Initialize data source connection. For CSV: validates directory structure For MySQL: establishes database connection

Types

data_type()

@type data_type() ::
  :biblio
  | :items
  | :members
  | :users
  | :authors
  | :publishers
  | :biblio_authors

source_type()

@type source_type() :: :csv | :mysql

Functions

close_source(source)

Close data source connection.

fetch_data(source, data_type, opts \\ [])

Fetch data of specified type from the configured source. Returns a stream of data rows.

get_data_count(source, data_type)

Get data count for specified type.

init_source(source_type)

Initialize data source connection. For CSV: validates directory structure For MySQL: establishes database connection