Skip to content

Commit 3213afb

Browse files
committed
Documentation Update
1 parent eb8d17b commit 3213afb

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ To update Quick SQL Connector to the latest version, add --upgrade flag to the a
2828

2929
### Creating instance of module
3030

31-
DB = quicksqlconnector('database','host', port, 'username', 'password', 'database-name')
31+
DB = quicksqlconnector('database','host', port, 'username', 'password')
32+
33+
NOTE : If you're using SQLite, you must provide database file name as follows.
34+
35+
DB = quicksqlconnector('sqlite3', database_name='my_example_database')
3236

3337
For database, it has 3 options (case-sensitive).
3438
* ```mysql```
@@ -39,16 +43,33 @@ For database, it has 3 options (case-sensitive).
3943
4044
DB.query('query','parameters:optional')
4145

46+
FOR SQLite, you don't need to use parameterized quieries as it is not supported in SQLite.
47+
4248
> It has two arguments, query and parameters, parameters are optional.
49+
50+
# EXAMPLES FOR 'MYSQL'
4351

4452
DB.query("SELECT * FROM test where id= %s", (input_user,))
4553
DB.query("SELECT * FROM test")
4654
DB.query('CREATE TABLE test(name varchar(10), id int(10))')
4755
DB.query("INSERT INTO test values(%s, %s)", ('harry', 13))
4856

57+
# EXAMPLES FOR 'SQLITE'
58+
59+
DB.query('DROP TABLE movie')
60+
DB.query("CREATE TABLE movie(title varchar(1), year int(1), score int(1))")
61+
62+
# EXAMPLE FOR 'POSTGRESQL'
63+
64+
DB.query('SELECT datname FROM pg_database')
65+
66+
See `test.py` for [more examples](https://github.com/Anas-Dew/QuickSQLConnector/blob/main/src/quicksqlconnector/test.py).
4967

5068
## 🔗Useful Links
51-
* Buy Us a Coffee - [Just one cup!](https://www.buymeacoffee.com/anasraza)
52-
* Email - [Click Here](mailto:[email protected])
53-
* PyPi - [Visit Here](https://pypi.org/project/quicksqlconnector/)
54-
* Website - [Visit Here](https://quicksqlconnector.web.app/)
69+
70+
| Route | Link |
71+
| ----------- | ----------- |
72+
| Buy me a Coffee | [Visit](https://www.buymeacoffee.com/anasraza) |
73+
| Email | [Visit](mailto:[email protected])|
74+
| PyPi | [Visit](https://pypi.org/project/quicksqlconnector/) |
75+
| Website | [Visit](https://quicksqlconnector.web.app/)|

src/quicksqlconnector/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# """))
3232

3333
# POSTGRESQL EXAMPLES
34-
DB = quicksqlconnector('postgres','localhost', 5432, 'postgres', 'anas9916')
34+
# DB = quicksqlconnector('postgres','localhost', 5432, 'postgres', 'anas9916')
3535
# print(DB.query('SELECT datname FROM pg_database'))
3636

3737
pass

0 commit comments

Comments
 (0)