Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TG-FileStream MySQL Patch

This repository is a patch for TG-FileStream. It allows you to use MySQL as Database instead of mongodb


1. Clone and Setup TG-FileStream

First, clone and setup the base project:

https://github.com/SpringsFern/TG-FileStream

Follow the setup instructions provided in that repository's README file.

Make sure TG-FileStream is fully working before continuing.


2. Installation Methods

You can install this plugin using either of the following methods.


Method 1 — Install as Plugin (Recommended)

You can install this plugin directly via pip using the Git repository:

pip3 install git+https://github.com/SpringsFern/tgfs-mysql

This method uses TGFS entry-point plugin loading and does not require placing files inside the patches directory.


Method 2 — Local Patch (Development)

Clone this repository inside the patches directory of TG-FileStream.

Your folder structure should look like this:

<TG-FileStream base folder>/
│
├── .git
├── tgfs/
│   ├── patches/
│   │   └── tgfs-mysql   ← clone this repo here

Example:

cd <TG-FileStream base folder>/tgfs/patches
git clone https://github.com/SpringsFern/tgfs-mysql

Install Requirements

Install required dependency:

pip3 install aiomysql

4. Setup Environment Variables

MySQL Environment Variables

Set the following variables if you choose MySQL as the database in DB_BACKEND

Variable Required/Default Description
DB_BACKEND Set it to mysql
MYSQL_HOST MySQL DataBase Host Name
MYSQL_PORT MySQL Database Port Number
MYSQL_USER MySQL Database Username
MYSQL_PASSWORD MySQL Database Password
MYSQL_DB MySQL Database Name
MYSQL_MINSIZE 1 Minimum sizes of the MySQL Connection pool
MYSQL_MAXSIZE 5 Maximum sizes of the MySQL Connection pool

5. Start or Restart the Bot

After installation, start or restart TG-FileStream:

python3 -m tgfs

Or restart the service if running in the background.


Done

The MySQL Database patch should now be active.

Make sure you restart the bot after adding the patch.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages