cools9 / ElementalDB

A database made in python meant to be superfast and easy to learn for beginners and meant to be a sql,sqlite and postgres competitor
MIT License
11 stars 9 forks source link
database dbms hacktoberfest python3

ElementalDB

ElementalDB Diagram

ElementalDB is a lightweight, easy-to-use database management system implemented in Python. It supports basic functionalities for creating, reading, updating, and deleting (CRUD) tables and their records, along with relationships between tables.

Features

Requirements

All the dependent libraries can be installed by running pip install -r requirements.txt

Installation

  1. Clone the repository:

    git clone https://github.com/cools9/ElementalDB
  2. Navigate into the project directory:

    cd ElementalDB
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

Here’s a basic example of how to use ElementalDB:

import asyncio
from elementaldb import ElementalDB  # Make sure to import your ElementalDB class

async def main():
    db = ElementalDB()
    await db.table_create("users", columns=["username", "password", "email"])
    await db.add('users', [["john_doe", "securepass", "john@example.com"],
                            ["jane_smith", "mypassword", "jane@example.com"]])

    # Search for a user
    results = await db.search('users', 'john_doe', 'username')
    print(results)

    # Update a user's information
    await db.update('users', row_number=1, data=["john_doe", "new_securepass", "john_new@example.com"])

    # Delete a user
    await db.delete('users', row_number=1)

# Run the async main function
asyncio.run(main())

Functions Overview

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes. Please visit Contribution guides for more information.

License

This project is licensed under the MIT License. See the LICENSE file for more details.