Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

MySQL-easy provides an easy access to MySQL database

Project description

MySQL easy

MySQL easy is a tool to augment your database development using MySQL. It gives you more insight into your MySQL database, by providing you an ability to graphically trace code dependencies between MySQL views, stored procedures and tables.

It is also an intelligent code generator. It generates code for you in SQL or in Python based on your table structure and relationships between the table. This tool will help debug larger database applications easily and write code in matter of clicks that you may require few days of effort.

SQL code

Sample code that you can use to create a table named user with three columns user_id, last_name and first_name.

CREATE TABLE `user` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(70) DEFAULT NULL,
  `last_name` varchar(70) DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

Code generation

Use MySQLeasy to generate code for your table. Once python class for user is generated run it.

Python code

Following code will insert a new user John Smith. Then search the records with last name Smith. Then update the first name to Mike in the first row. Update the records in database and at the end close the connection.

from mysqleasy.Connection import Connection as Connection
from mysqleasy.Access import Access as Access
connector = "mysqlconnector"
db_config = {'host': 'your_database_host_address', 'user': 'your_database_user_name', 'password': 'your_database_password'}
conn = Connection.create(connector, db_config)
last_row_id = user.insert(conn, first_name = "John", last_name = "Smith")
columns, users = user.search(conn, last_name='Smith')
user_list = [o for o in Access.iter_object(columns, users)]
last_row_id, count_affected = user.insertupdate_multiple(conn, [('Mike', 'Smith', 1)])
conn.commit()
conn.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mysqleasy, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size mysqleasy-0.0.2-py3-none-any.whl (6.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size mysqleasy-0.0.2.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page