Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The purpose of this library is for better managament and maintenance of the code

## Parameter Format:
- connection_string: dict
```
```Python
connection_string = {
'PG_HOST': 'YOUR_CONNETION_HOST_ADDRESS',
'PG_PORT': 'YOUR_CONNECTION_PORT',
Expand All @@ -15,11 +15,11 @@ The purpose of this library is for better managament and maintenance of the code
}
```
- connection_object: Callable
```
```Python
connection_object = psycopg2.connect(host,port,database,user,password) #object created from psycopg2.connect()
```
- where: List(dict)
```
```Python
where = [
{
'column_name': 'some_column_name',
Expand All @@ -33,20 +33,20 @@ The purpose of this library is for better managament and maintenance of the code
- main_table: Union[dict, str]

For **select** query
```
```Python
main_table = {
'table': 'some_table_name',
'alias': 'some_alias_for_table',
},
```

For **transaction** query
```
```Python
main_table = 'some_table_name'
```

- join_table: List(dict)
```
```Python
join_table = [
{
'table': 'some_table_name',
Expand All @@ -58,19 +58,19 @@ The purpose of this library is for better managament and maintenance of the code
```

- column_name: List(str)
```
```Python
column_name = ['some_column_name', 'some_column_name', 'some_column_name',]
```

- column_and_value: dict
```
```Python
column_and_value = {
'some_column_name': 'some_value', # for multiple values just provide more key:value pair
}
```

- order: dict
```
```Python
order = {
'some_column_name': 'ASC', # accepted order values are (ASC, DESC), for multiple order conditions just provide more key:value pair
}
Expand Down Expand Up @@ -115,7 +115,7 @@ Example DB
```

Code samples:
```
```Python
# without joining table

from postgres_dynamic import PGDGet
Expand All @@ -142,7 +142,7 @@ Example DB
# {'first_name': 'Alex'}
```

```
```Python
# with join table salaries

query_result = PGDGet.get_one(
Expand Down Expand Up @@ -192,7 +192,7 @@ Example DB
```

Code samples:
```
```Python
from postgres_dynamic import PGDGet
import asyncio

Expand Down Expand Up @@ -234,7 +234,7 @@ Example DB
```

Code samples:
```
```Python
# with auto commit

from postgres_dynamic import PGDTransaction
Expand All @@ -255,7 +255,7 @@ Example DB
# will insert a new employee to the employees table
```

```
```Python
# without auto commit

connection_object = psycopg2.connect(database='postgres', host='localhost', port=5432, user='postgres', password='password')
Expand Down Expand Up @@ -295,7 +295,7 @@ Example DB
```

Code samples:
```
```Python
# with auto commit

from postgres_dynamic import PGDTransaction
Expand All @@ -319,7 +319,7 @@ Example DB
# will update employee first_name and last_name with id 6
```

```
```Python
# without auto commit

connection_object = psycopg2.connect(database='postgres', host='localhost', port=5432, user='postgres', password='password')
Expand Down Expand Up @@ -362,7 +362,7 @@ Example DB
```

Code samples:
```
```Python
# with auto commit

from postgres_dynamic import PGDTransaction
Expand All @@ -385,7 +385,7 @@ Example DB
# will delete salary data with employee_id 6
```

```
```Python
# without auto commit

connection_object = psycopg2.connect(database='postgres', host='localhost', port=5432, user='postgres', password='password')
Expand Down