Skip to main content

Hypi MekaDB database client

Project description

Hypi's MekaDB client

Register a https://hypi.ai/mekadb

Usage

if __name__ == '__main__':
    async def main():
        # Create an instance of the MekaDBClient
        client = MekaDBClient()
        # Connect to Hypi and keep a connection in the background
        await client.run()
        # Login to get authentication context
        auth = await client.login('<username>', '<password>', '<database name>')
        res = await client.query(creds=auth,
                                 sql='CREATE TABLE IF NOT EXISTS user(username VARCHAR, pass VARCHAR, PRIMARY KEY (username))')
        print("Create table:", res)
        res = await client.query(creds=auth,
                                 sql="INSERT INTO user(username,pass) VALUES('courtney','pass1'),('damion','pass2')")
        print("Insert:", res)
        res = await client.query(creds=auth, sql='SELECT * FROM user WHERE pass = :pass', params={'pass': 'pass99'})
        print("Select:", res)

        # Close the connection
        await client.close()


    # Run the main function within an asyncio event loop
    asyncio.run(main())

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

mekadb-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

mekadb-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file mekadb-0.1.0.tar.gz.

File metadata

  • Download URL: mekadb-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mekadb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f1295c6076ad169f33db135843e6e4fe5cd9022db1c3954c87e6f9f8ca221fa
MD5 ce9de8ac94f3a6b5e5a35e2b4d3c68eb
BLAKE2b-256 24b0cc4994cd0c7504ca18e46798d3abe00deaf1fef3578c9e8aee0a9f17d134

See more details on using hashes here.

File details

Details for the file mekadb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mekadb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for mekadb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae5b6b56b62f158f8db51113c28cdb49bdc0c0c5094d7e428cafd1d3921cb3ee
MD5 962bd87d3c0fa7a97e53f0bfbdd6e01a
BLAKE2b-256 b1d65950b0d465b5e1aff8fd52f306d51bde1d88daccc5b10a2a426eedb3c742

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