Skip to main content

An async package that makes database handling extremely easy!

Project description

directdb

A simple library that makes handling SQL databases in python easy without the need to understand the syntax. The library would act like an interface between your code and the database server parsing the data to SQL format.

If you enjoy using this project, consider giving it a star as it helps out a ton <3

Currently Supported Databases:

  • PostgreSQL

  • SQLite

Github Repository

https://github.com/cannonballchris/directdb

Installation

To install the library, use pip install directdb

License

GPL-3.0

Documentation

Documentation

Usage/Examples

Using the library with a discord bot

import asyncio



import discord

from discord.ext import commands

from directdb import Postgresql



class MyBot(commands.Bot):

    def __init__(self):

        super().__init__(command_prefix = "!", intents = discord.Intents.all())

    

    async def setup_hook(self):

        setattr(self, "db", Postgresql(

            host = "localhost",

            user = "username",

            password = "password",

            database = "Database name here",

            port = 5000 #Your db port address here

        ))

        await self.db.connect()

        print("DB Ready")



if __name__ == "__main__":

    asyncio.run(MyBot().run("TOKEN"))

Using the library normally without a discord bot context.

import asyncio



from directdb import Postgresql



async def database(host, user, password, database, port):

    db = Postgresql(host = host, user= user, password = password, database = database, port = port)

    await db.connect()



asyncio.run(database(...))

Contributing

You can contribute to this project by providing valueable suggestions and reporting issues in our Discord Server

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

directdb-1.2.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

directdb-1.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file directdb-1.2.0.tar.gz.

File metadata

  • Download URL: directdb-1.2.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for directdb-1.2.0.tar.gz
Algorithm Hash digest
SHA256 465a9ae4338266515ea55fe116207bef93f0f752bd6becd34f4b78eb12c87472
MD5 dc70b6205c455148af0756d4fce51a1c
BLAKE2b-256 8517044b4ebf9e4feb54d175728f52bcc12aa8008968ab8fa500839305ceac7f

See more details on using hashes here.

File details

Details for the file directdb-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: directdb-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for directdb-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed190af4c3df99cc2945cd5cbc7a85e0f9580fe66cb5e72e2bb23f4a556175f4
MD5 5cfd239e7c54d53b0815aac83a7ac18d
BLAKE2b-256 a9a4b6b777a4f0d02a7c5ca211556fa3b9cd6c98758eea05fd61d05e69183e36

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