From f8102c59acc7f66ee2d9f17897afa5a6065340fe Mon Sep 17 00:00:00 2001 From: Bayu Satria Gemilang Date: Mon, 31 Oct 2022 09:54:26 +0700 Subject: [PATCH] update readme --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ea08d8a..3c69750 100644 --- a/README.md +++ b/README.md @@ -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', @@ -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', @@ -33,7 +33,7 @@ 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', @@ -41,12 +41,12 @@ The purpose of this library is for better managament and maintenance of the code ``` For **transaction** query - ``` + ```Python main_table = 'some_table_name' ``` - join_table: List(dict) - ``` + ```Python join_table = [ { 'table': 'some_table_name', @@ -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 } @@ -115,7 +115,7 @@ Example DB ``` Code samples: - ``` + ```Python # without joining table from postgres_dynamic import PGDGet @@ -142,7 +142,7 @@ Example DB # {'first_name': 'Alex'} ``` - ``` + ```Python # with join table salaries query_result = PGDGet.get_one( @@ -192,7 +192,7 @@ Example DB ``` Code samples: - ``` + ```Python from postgres_dynamic import PGDGet import asyncio @@ -234,7 +234,7 @@ Example DB ``` Code samples: - ``` + ```Python # with auto commit from postgres_dynamic import PGDTransaction @@ -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') @@ -295,7 +295,7 @@ Example DB ``` Code samples: - ``` + ```Python # with auto commit from postgres_dynamic import PGDTransaction @@ -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') @@ -362,7 +362,7 @@ Example DB ``` Code samples: - ``` + ```Python # with auto commit from postgres_dynamic import PGDTransaction @@ -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')