Metadata-Version: 2.4
Name: mysqleasy
Version: 0.0.1
Summary: MySQL-easy provides an easy access to MySQL database
Home-page: https://www.mysqleasy.com
Author: Neelofar Farukh Tamboli
Author-email: tamboli.neelofar@gmail.com
License: Proprietary
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: mysql-connector-python
Requires-Dist: pymysql
Requires-Dist: pyodbc
Requires-Dist: pymssql
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: summary

# MySQL easy

MySQL easy is a tool to augment your database development using MySQL.

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. 

## Pre-requisite
pymysql => pip install pymysql
mysql => pip install mysql-connector-python
redis => pip install redis


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

```sql
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](http://www.mysqleasy.com) 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.

```python
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()
``` 
