Skip to main content

A package used to modify & view your MySQL database data dynamically

Project description

Discord Mysql Management Framework

This package is used to dynamically add new data to your existing Mysql tables.
You're also able to delete or view data.
It'll return you an embed & a view for you to send back.

Built With

Python MySQL Discord

How to get started

  1. Install the package
pip install dbpyman
  1. Create a new command for your discord Bot and create a database object inside that.
database = Database(host='db_host',
                    user='db_user',
                    password='db_password',
                    port=3306,
                    database_name='db_name',
                    charset='utf8mb4')
  1. Call create_db_management and pass the database object as the parameter and return your embed & view
database = Database(host='db_host',
                    user='db_user',
                    password='db_password',
                    port=3306,
                    database_name='db_name',
                    charset='utf8mb4')

embed, view = dbpyman.create_db_management(database)
  1. Use the returned embed & view and attach them to your message
database = Database(host='db_host',
                    user='db_user',
                    password='db_password',
                    port=3306,
                    database_name='db_name',
                    charset='utf8mb4')

embed, view = dbpyman.create_db_management(database)

await interaction.response.send_message(embed=embed, view=view)

Advanced usage

The framework features various methodes to further customize the UI & behavior of your data management process.

Hide certain tables from the embed

In general the framework will attach all tables as buttons to the view.
You can prevent that by using

database = Database(...)
database.set_table_hidden('MyTableName')
database.set_table_hidden('MySecondTableName')

embed, view = dbpyman.create_db_management(database)

Set a default value for a column

This will set a default value for that specific column. When adding data to a table, you'll see the default value as the input preview. This will also allow you to skip the insertion of those specific column input fields and simply use the assigned default value when that input field is empty ( even if the table is marked as NOT NULL ).

database = Database(...)
database.set_column_default_value('MyTableName', 'MyColumnName', 0)
database.set_column_default_value('MySecondTableName', 'MySecondColumnName', 'Banana')

embed, view = dbpyman.create_db_management(database)

Contribute

Feel free to contribute to the project, it's open source.
It's probably possible to not only support MySQL and work with inheritance to allow other database types.

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

dbpyman-0.1.211.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

dbpyman-0.1.211-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file dbpyman-0.1.211.tar.gz.

File metadata

  • Download URL: dbpyman-0.1.211.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for dbpyman-0.1.211.tar.gz
Algorithm Hash digest
SHA256 dc079fdee6a3d41ee2ea1caf09b57e313fa5d3bdd060c6dd76a00e072eb47c21
MD5 13748c0a4b56c985afaf9e9cb35b2b69
BLAKE2b-256 443c05008e754fc272fc2e6ac38be060cfeb8273736babc803bb6577a8a50047

See more details on using hashes here.

File details

Details for the file dbpyman-0.1.211-py3-none-any.whl.

File metadata

  • Download URL: dbpyman-0.1.211-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for dbpyman-0.1.211-py3-none-any.whl
Algorithm Hash digest
SHA256 3bc4369c0c50192a8529ddb21ac6f20c310ced5b6e3d8a579adfeef741a843e0
MD5 ba9ee9f36b6f5f4a9f8b6e455dd0cf63
BLAKE2b-256 3712beb0e4a96b1692cc1a47d777cec0c9ffc07463602c1b3b03af6eaf7fa694

See more details on using hashes here.

Supported by

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