Voile.Migration.MySQLAdapter (Voile v0.1.26)

Copy Markdown View Source

MySQL/MariaDB database adapter for reading SLiMS data directly from MySQL or MariaDB database.

This module provides functionality to connect to a MySQL or MariaDB database and read SLiMS data directly instead of using CSV files. Both database systems are fully supported using the same configuration and connection methods.

Configuration example in config/dev.exs:

config :voile, :mysql_source,
  hostname: "localhost",
  port: 3306,                    # Default port for both MySQL and MariaDB
  username: "slims_user",
  password: "slims_password",
  database: "slims_database"

Summary

Functions

Closes the MySQL connection.

Establishes connection to MySQL database for SLiMS data. Returns the connection process or error.

Fetches author data from MySQL mst_author table.

Fetches biblio-author relationship data from MySQL biblio_author table.

Fetches bibliography data from MySQL biblio table. Returns stream of data similar to CSV format.

Fetches item data from MySQL item table.

Fetches member data from MySQL member table.

Fetches publisher data from MySQL mst_publisher table.

Fetches user data from MySQL user table.

Gets the count of records in a table.

Functions

close(conn)

Closes the MySQL connection.

connect()

Establishes connection to MySQL database for SLiMS data. Returns the connection process or error.

fetch_author_data(conn, opts \\ [])

Fetches author data from MySQL mst_author table.

fetch_biblio_author_data(conn, opts \\ [])

Fetches biblio-author relationship data from MySQL biblio_author table.

fetch_biblio_data(conn, opts \\ [])

Fetches bibliography data from MySQL biblio table. Returns stream of data similar to CSV format.

fetch_item_data(conn, opts \\ [])

Fetches item data from MySQL item table.

fetch_member_data(conn, opts \\ [])

Fetches member data from MySQL member table.

fetch_publisher_data(conn, opts \\ [])

Fetches publisher data from MySQL mst_publisher table.

fetch_user_data(conn, opts \\ [])

Fetches user data from MySQL user table.

get_table_count(conn, table_name)

Gets the count of records in a table.