small (wip) wrapper for rds data api for lambda
Project description
Broly
Small module for managing models with the AWS rds data-api from lambda. Should be set into a lambda layer.
Uses pypika to generate MySQL and boto3's rds-data client.
MVP Features:
- Generic model class
- Model manipulation
- Insert
- Update
- Autoincrement option
- Read by column and parse response
- Parsing datetimes
- Table creation
- Bulk get
- Take pypika get queries to execute directly
- Main MySQL column classes
- Wait for serverless wakeup, boto3 doesn't retry automatically if db is 'asleep'
- Delete
- Order results for get queries
- Raw SQL escape hatch
To add to lambda layer
mkdir python
pip3 install broly --target python/
zip -r python layer
Then just upload it to your lambda's layer.
Usage
from broly.model import Model
from broly.column import IntColumn, VarChar
class Example(Model):
table_name = 'example'
secret_arn = 'secret-arn'
resource_arn = 'resource-arn'
database = 'db-name'
id = IntColumn(primary_key=True)
name = VarChar(nullable=False)
description = VarChar(size=1000)
e = Example(name="name")
e.set_value('description', 'desc')
print(e)
e = e.save()
print(e)
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
broly-0.1.4.tar.gz
(8.2 kB
view details)
Built Distribution
broly-0.1.4-py3-none-any.whl
(6.0 kB
view details)
File details
Details for the file broly-0.1.4.tar.gz
.
File metadata
- Download URL: broly-0.1.4.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02f5978c23b7cd187bc5ffecb5aad0b2edd9c94ff00de5b65d107d979e8cb566 |
|
MD5 | 2f09c45b56b5184abae116e894c643a4 |
|
BLAKE2b-256 | af767731fbb6f0652551b5d675ec96dca77b203aed86b605a9728592549c538e |
File details
Details for the file broly-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: broly-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7530e9d1e399e0ffb3bb92c9924fd05ea93216b6bd2a1171f1792ff1798c0191 |
|
MD5 | 8afed4ce3c37d6699b6734f8e14c6f3c |
|
BLAKE2b-256 | b27ea6c23c3e69177d6e8197f6dc04b9f1cc4567893a0183df84ec910d034381 |