making SQLAlchemy great again
Project description
SQLAlchemy Lightening
Making SQLAlchemy great again
Install
pip install sqlalchemy_lightening
Usage
# load by id
Person.get(1)
# load multiple by id
Person.get([1, 2, 3])
# basic filter
Person.where(name='dpepper')
# where `name` in ...
Person.where(name=['dpepper', 'thatguy'])
# mix and match
Person.where(Person.id != 1, name='dpepper')
# standard utilities
Person.all
Person.first
# standard SQLAlchemy query
Person.query
Example Setup
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import declarative_base, sessionmaker
from sqlalchemy_lightening import LighteningBase
# create base sqlalchemy model
Base = declarative_base()
# extend LighteningBase mixin
class Person(LighteningBase, Base):
id = Column(Integer, primary_key=True)
name = Column(String(250))
engine = create_engine('sqlite:///:memory:')
session = sessionmaker(bind=engine)()
Base.metadata.create_all(engine)
# wire things up
LighteningBase.query_class = session.query
# good to go
Person.winning
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
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
File details
Details for the file sqlalchemy_lightening-0.7.0.tar.gz.
File metadata
- Download URL: sqlalchemy_lightening-0.7.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a66b46c0aac17cf149e1c7764dddb9ac655b913efbed990d0474b6e3bbfb9300
|
|
| MD5 |
5db97b6a8a4c67f9482eb7a3f880768c
|
|
| BLAKE2b-256 |
6f153ad77e6352ed51e161a109836c44b62cf963782e4236636c6a701110723e
|
Provenance
The following attestation bundles were made for sqlalchemy_lightening-0.7.0.tar.gz:
Publisher:
python.yml on dpep/py_sqlalchemy_lightening
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqlalchemy_lightening-0.7.0.tar.gz -
Subject digest:
a66b46c0aac17cf149e1c7764dddb9ac655b913efbed990d0474b6e3bbfb9300 - Sigstore transparency entry: 1812032939
- Sigstore integration time:
-
Permalink:
dpep/py_sqlalchemy_lightening@77503bb2a4f4ca420b81b356dd3a04231b48c270 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/dpep
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@77503bb2a4f4ca420b81b356dd3a04231b48c270 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sqlalchemy_lightening-0.7.0-py3-none-any.whl.
File metadata
- Download URL: sqlalchemy_lightening-0.7.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d785427330fa993531f0d956558cb9d3f7e08e83185ad9a6817ca23c5e92c5d
|
|
| MD5 |
906179f5063b4d598a17ae972fbffc72
|
|
| BLAKE2b-256 |
4fc18c21a9325d68a3a3ae066bab0af67e670486119e4519c76824e6e8b497cf
|
Provenance
The following attestation bundles were made for sqlalchemy_lightening-0.7.0-py3-none-any.whl:
Publisher:
python.yml on dpep/py_sqlalchemy_lightening
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqlalchemy_lightening-0.7.0-py3-none-any.whl -
Subject digest:
5d785427330fa993531f0d956558cb9d3f7e08e83185ad9a6817ca23c5e92c5d - Sigstore transparency entry: 1812033008
- Sigstore integration time:
-
Permalink:
dpep/py_sqlalchemy_lightening@77503bb2a4f4ca420b81b356dd3a04231b48c270 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/dpep
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@77503bb2a4f4ca420b81b356dd3a04231b48c270 -
Trigger Event:
push
-
Statement type: