https://github.com/diversen/python-mysql-object
Small MySQL class for doing simple database operations.
https://github.com/diversen/python-mysql-object
Last synced: 11 months ago
JSON representation
Small MySQL class for doing simple database operations.
- Host: GitHub
- URL: https://github.com/diversen/python-mysql-object
- Owner: diversen
- License: mit
- Created: 2022-12-14T16:41:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-19T11:40:36.000Z (about 2 years ago)
- Last Synced: 2025-04-02T07:28:30.760Z (over 1 year ago)
- Language: Python
- Size: 44.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python mysql object
Simple Python Sqlite3 CRUD and query tool
The main usage is probably if you don't use a ORM, but query the database directly.
## Install python-mysql-object
pip install git+https://github.com/diversen/python-sqlite-object
Or using a tag (latest):
pip install git+https://github.com/diversen/python-sqlite-object@v0.0.1
## Usage
See [example.py](example.py) for an example.
## Tests
The following SQL creates the database and the test table:
```sql
CREATE TABLE IF NOT EXISTS tests (
test_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
```
To run the tests:
python -m unittest discover -s tests
## License
[MIT](LICENSE)
# python-sqlite-object