🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

postgres-helper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postgres-helper

Package for Postgres query on python

0.0.5
PyPI
Maintainers
1

Postgres Helper

The postgres-helper library is build on top of psycopg2. It will be really helpful for running the basic postgresql query in python.

Checkout the official documentation of this library here: postgres-helper.readthedocs.io/

Installation

For installation of postgres-helper, you need to run following command

pip install postgres-helper

Examples using this library

Please check the official documentation here: https://postgres-helper.readthedocs.io/.

#Library import
from pg.pg import Pg

# Initialization of library
pg = Db(dbname='postgres', user='postgres', password='admin', host='localhost', port='5432')

# Get the column names of the specific table
pg.get_columns_name(table='pg_table')

# Get values from specific column of table
pg.get_values_from_column(column='pg_table_col', table='pg_table', schema='public')

# Create schema
pg.create_schema(name='schema_name')

# Create column
pg.create_column(column='col_name', table='pg_table', col_datatype='varchar', schema='public')

# Update column
pg.update_column(column='col_name', value='updated_value', table='pg_table', where_column='where_col', where_value="where_val", schema='public')

# Delete table
pg.delete_table(name='pg_table', schema='public')

# Delete values
pg.delete_values(table_name='pg_table', condition='name=value', schema='public')

Keywords

postgresql

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts