Git Product home page Git Product logo

infinitum's Introduction

Infinitum

Description

Databases suck. ORMs are tedious. I got tired of all that, so I developed an abstraction layer that leverages existing functionality in your database.

Why build boilerplate objects for SerDe when you can just use the existing DB schema.

Right now, it's just postgres. In the future I intend to expand to other DB systems.

Feel free to fork and contribute. Ideas are welcome.

This is really meant for JSON-based transactional systems, like API backends, so for data analytics you're better off using something like pandas, polars, or something of the like.

Installation

pip install infinitum

Usage

  1. Connect to your database
from infinitum import main as inf

conn = inf.connect_to_database(host, database, user, password)
  1. Crud operations
# Create
data = {
    'id': 1,
    'name': 'test'
}
inf.create(conn, table_name, data)

# Read
#   this function leverages column names to build a filtered query.
#   make sure your column has "id" in its name so it can generate the list of filters
#   this will be less dumb in the future
data = {
    'id': 1
}
inf.read(conn, table_name, data)

# Update
data = {
    'id': 1,
    'name': 'test2'
}
inf.update(conn, table_name, data)

# Delete
data = {
    'id': 1
}
inf.delete(conn, table_name, data)

# Read all
# This just pulls everything.
inf.read(conn, table_name, {})

infinitum's People

Contributors

hochen97 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.