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.2.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

directdb-1.2.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: directdb-1.2.2.tar.gz
  • Upload date:
  • Size: 18.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.2.tar.gz
Algorithm Hash digest
SHA256 debd224039de8c5c4ca285330415d798bea4d30259f4f997965f26d087ee3919
MD5 f07278e369a51097fe729bce7a686914
BLAKE2b-256 860ae179dc88f5b58643c279c73106b8cf533a8f60a365ed3a46c52e934879f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: directdb-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b1adfa8e499501a523ff7d5cd2f67278ad48e12870252fa0f5fe3e1c342ec73
MD5 207e6a76f7a766433d545fec589a0d1c
BLAKE2b-256 d9dfede59add59ac8f0e2c371deb72654d3fa3336ddf2bd808b5b242ad76da14

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