updatemysql1B module
This is the documentation for updatemysql.py.
- This file contains a set of functions that:
Create tables in the MySQL database if they do not yet exist.
2. After establishing a connection to the MySQL server, tables for farside, XT-cut, composite map, SO-PHI, and synoptic map can be created and populated with the following information: tag, filename, date_range, latest_date, caption, file_creation_time, and filepath.
- updatemysql1B.connect_to_mysqlA()[source]
Summary: Connect to a MySQL server using the provided configuration and return the connection object.
Description: This function establishes a connection to a MySQL server using the parameters specified in the ~/.my.cnf configuration file and connects to the ‘Farside’ database. If the connection is successful, it returns the connection object. If the connection fails, a RuntimeError is raised.
Parameters: None Returns: pymysql.connections.Connection: A connection object to the MySQL server. Raises: RuntimeError: If the connection to the MySQL server is not open.
- Example:
>>> connection = connect_to_mysql() >>> # Perform database operations using the 'connection' object.