A SQL ORM Tool
Project description
Golla
- A SQL Query free ORM
- Support SQLAlchemy ORM
Create Connection
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
host = 'localhost'
user = 'postgres'
password = 'root'
data_base = 'postgres'
port = '5432'
URL = 'postgresql://{}:{}@{}:{}/{}'
URL = URL.format(user, password, host, port, data_base)
ds_schema = 'public'
engine = create_engine(URL, encoding='utf8')
engine.connect()
Connection = sessionmaker(bind=engine)()
Create Model class
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Integer, String, Column
from golla.table import BaseChild
Base = declarative_base()
BaseChild.Connection = Connection
class Employee(Base, BaseChild):
__tablename__ = "employee"
EMPID = Column("emp_id", Integer, primary_key=True)
NAME = Column("NAME", String)
Age = Column("Age", Integer)
Save object into DB
e = Employee()
e.EMPID = 203
e.Age = 20
e.NAME = "b"
Employee.save(e)
Get records from table by id
emp = Employee().get_by_id(EMPID=100)
Get all records
emps = Employee().get_all()
Delete records from table by id
Employee().delete_by_id(EMPID=201)
MIT License : Copyright (c) 2019 Abhimanyu Haralukallu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Golla-0.0.0.tar.gz
(2.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
Golla-0.0.0-py3-none-any.whl
(2.5 kB
view details)
File details
Details for the file Golla-0.0.0.tar.gz.
File metadata
- Download URL: Golla-0.0.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
500a8c9ceaeedff02b2505c94a3b183498491e0e817fe8415633443fbb91bb3d
|
|
| MD5 |
95a7febd89bee7cbdbbba4efa78aa249
|
|
| BLAKE2b-256 |
849c8a0d909d24f011f8564aaf0ab698127e321e893548fe9ed7ef06d72f27c4
|
File details
Details for the file Golla-0.0.0-py3-none-any.whl.
File metadata
- Download URL: Golla-0.0.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaf2e1c728aafdae2f4811204adc19200031d5975e2152f0a0912a13d0a7d3ee
|
|
| MD5 |
597ffde7c45152ff4d410f1e7a176f14
|
|
| BLAKE2b-256 |
86470a69a008c80d24edc3baf6719d64c3477007f37a9f3fed0c118d53f76753
|