kg_idg.utils.sql_utils

Functions

make_temp_mysql_db(username, db_name)

Creates a temporary MySQL database with the provided name.

make_temp_postgres_db(username, db_name)

Creates a temporary PostgreSQL database with the provided name.

process_data_dump(short_name, db_type, …)

Given the path to a database dump, filters the file by table, loads each table, and exports each table as its own TSV.

process_mysql_dump(short_name, db_name, …)

Given the path to a MySQL dump, filters the file by table, loads each table, and exports each table as its own TSV.

process_postgresql_dump(short_name, db_name, …)

Given the path to a PostgreSQL dump, loads it, then exports each table as its own TSV.