Skip to main content

this package is use for sql CRUD operations on sql database.

Project description

sql_operation

Under construction! Not ready for use yet! Currently experimenting and planning!

Developed by Sachin Indoriya (c) 2022

Examples of How To Use (Buggy Alpha Version)

from sql_operations  import SqlDB

 
# mysql connection credentials
USERNAME = 'username'
PASSWORD = 'password'
DATABASE = 'database_name'
HOST = 'host'

# create SqlDB object
sql_db = SqlDB(dummy_data)

# check sql server is connected or not
if sql_db.is_conneted():
    print("Hurrey!!!, sql server connected.")
else:
    print("sql server not connected.")


# create a table
table_name = "new_table"
columns = ['col_1','col_2','col_3']
sql_db.create_table(table_name,columns)


# check table created or not
if sql_db.check_table_exist():
    print("table exist")
else:
    print("table not exist")

# insert row into table
table_name = "new_table"
row = ['val_1','val_2','val_3']
if sql_db.insert_into_table() == 1:
    print("row inserted")
    

# read row from the table
table_name = "new_table"
item_id = "item_id"
rows = sql_db.read_rows(table_name,item_id)
print(rows)

# delete row from table
table_name = "new_table"
item_id = "item_id"
if sql_db.delete_rows(table_name,item_id) == 1:
    print("row deleted")

# close database connection
sql_db.close_conn()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sql_oprations-0.0.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sql_oprations-0.0.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file sql_oprations-0.0.3.tar.gz.

File metadata

  • Download URL: sql_oprations-0.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9

File hashes

Hashes for sql_oprations-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9725faf3127b18864375264cb857968586a8d94f00f771085c5df1b9e056ab15
MD5 3c8f334395785ebf05df0778037be262
BLAKE2b-256 65409a1e79eadbf00e7c3f78b9b08776b9bb8cd7789ac2257f6d57facdae1dc1

See more details on using hashes here.

File details

Details for the file sql_oprations-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sql_oprations-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9

File hashes

Hashes for sql_oprations-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0c8c39e5470c035259303d5eea3ebe9219d7cf9962f431f5e71df6f8a7aea7ba
MD5 cff171d3369f99dd744cedd6e1a225ea
BLAKE2b-256 de7af4b1b4c771bb8b686174266ac6ca4e5fbfc355454e096927dfa962f0368b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page