flask-mysql icon indicating copy to clipboard operation
flask-mysql copied to clipboard

Where can I get a proper documentation or at least see the code

Open Pixelherz23 opened this issue 3 years ago • 3 comments

Is there any documentation that lists all the methods with an explanation? Is there at least MySQL class code with some comments? I cant find anything :(. Only found this: https://flask-mysql.readthedocs.io/en/stable/ which only helps for the start.

Best regrads

Pixelherz23 avatar Nov 18 '21 11:11 Pixelherz23

I think I found what I was looking for: https://github.com/PyMySQL/PyMySQL#documentation

But I am quite confused. Why should I use the mysql through flask-mysql?

I also stumbled across mysql connector . Whats the difference between pymysql and mysql connector?

Pixelherz23 avatar Nov 18 '21 11:11 Pixelherz23

@Pixelherz23 there are multiple ways to create a connection between python and mysql server , you can get the list of modules here the advantage of using flask is that we can handle the POST requests as well. but there are two repositories on github

  1. cyberdelia/flask-mysql
  2. alexferl/flask-mysqldb

which are totally useless, when you find out flask has nothing to do with mysql.

get official python - mysql documention : https://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html

patilabhay679 avatar Feb 02 '22 17:02 patilabhay679

@abhaypatil679 that's not quite true, flask-mysql extension takes care of making sure you only have one connection per request, so even if you call get_db() N times you only actually create 1 connection.

drum445 avatar Feb 20 '22 18:02 drum445