This section provides all the tools needed to create and manage databases for the Smartswap project.
Important
You can add this repository as a submodule in any part of the Smartswap project to easily access and use the mng/ functions.
Caution
When using the create_env script, please pay attention to the prompts it provides. If the databases already exist on your machine, the script will ask if you want to proceed with an "over-setup-env." Choosing this option will delete all existing databases and recreate new, empty ones.
To create or recreate the databases and set up the environment, run:
python create_env/create_env.pyYou will need to provide the following parameters:
sql_host: The host where the SQL service is running. Uselocalhostfor local, or an IP address (e.g.,192.168.1.50) for a local network machine. For online services, use the public IP address.sql_userandsql_password: Credentials with sufficient privileges to grant access to new users. For simplicity, you can useroot.db_useranddb_password: Credentials for accessing the Smartswap databases. The script will grant all necessary privileges to this user by default.
Once your environment is set up, you can use the management functions to interact with the databases. For detailed information, refer to the mng/ folder and the mng/README.