From 19473154483ebcdbc5c50b902f9e4561280b8998 Mon Sep 17 00:00:00 2001 From: ge Date: Sun, 9 Jul 2023 03:50:37 +0300 Subject: [PATCH] upd README --- README.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d0fbc8c..3d0b036 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ Quicker is a pythonic tool for querying databases. Quicker wraps popular Python packages: - `mysqlclient` for MySQL. -- `psycopg2` for PostgreSQL. -- Python builtin `sqlite` for SQLite. +- `psycopg2` for PostgreSQL (not implemented yet). +- Python builtin `sqlite` for SQLite (not implemented yet). Connection parameters will passed to "backend" module as is. -# `Connection` class +# Usage `Connection` is context manages and must be used with `with` keyword. `Connection` returns `Query` callable object. `Query` can be called in this ways: @@ -22,8 +22,6 @@ with Connection(**config) as query: query("sql query here...") ``` -# `Query` - `Query` cannot be called itself, you must use `Connection` to correctly initialise `Query` object. Methods and properties: @@ -32,10 +30,6 @@ Methods and properties: - `commit()`. Write changes into database. - `cursor`. Call [MySQLdb Cursor object](https://mysqlclient.readthedocs.io/user_guide.html#cursor-objects) methods directly. -# Examples - -## SELECT - ```python import json @@ -74,9 +68,7 @@ print(json.dumps(users, indent=4)) ] ``` -## Change database - -``` +```python from quicker import Connection with Connection(provider='mysql', read_default_file='~/.my.cnf') as db: