A Python package for managing database operations with a focus on logging and simple CRUD operations.
Project description
DBops Manager
A Python package for managing database operations with a focus on logging and CRUD operations.
Installation
You can install the package using pip:
pip install dbops-manager==0.1.6
Features
- Connection Management: Easily manage database connections with support for environment variables.
- CRUD Operations: Perform Create, Read, Update, and Delete operations on your database.
- Logging: Log operations to the database for better tracking and debugging.
Usage
Basic Usage
from dbops_manager.postgres_ops import PostgresOps
# Initialize the PostgreSQL operations
db_ops = PostgresOps()
# Create a table
db_ops.create_table('test_table', 'id SERIAL PRIMARY KEY, name VARCHAR(100), age INTEGER')
# Insert a row
db_ops.insert('test_table', {'name': 'Alice', 'age': 30})
# Fetch rows
rows = db_ops.fetch('test_table')
print(rows)
# Update a row
db_ops.update('test_table', {'name': 'Bob'}, 'id = 1')
# Delete a row
db_ops.delete('test_table', 'id = 1')
Logging
The package logs operations to the dbops_manager_logs table. Ensure that the logging_enabled parameter is set to True when initializing PostgresOps.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbops_manager-0.1.6.tar.gz.
File metadata
- Download URL: dbops_manager-0.1.6.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cb92901c26262a693d2a09397246544bbf23dd6b80719807ee1199a59db6091
|
|
| MD5 |
f3770be963442a441b9b58348a926cf0
|
|
| BLAKE2b-256 |
cac9ad260f63b608e455f29153e222b7341067da1df67d31af40f80ab0f60ead
|
File details
Details for the file dbops_manager-0.1.6-py3-none-any.whl.
File metadata
- Download URL: dbops_manager-0.1.6-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96fbe9db2eda92f1bdfd9eae93a3aef3bfdb5858f42bc7c26b966d63de813682
|
|
| MD5 |
c63790701d7a64bfde19d53d9b796a50
|
|
| BLAKE2b-256 |
25ccd3564d8139176209af151d5180340a2e15052711a1b940f388fbe4fe9907
|