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
- Table creation
- Bulk get
- Take pypika get queries to execute directly
- Main MySQL column classes
- Basic error response handling
- Wait for serverless wakeup, boto3 doesn't retry automatically if db is 'asleep'
- Tests
- Order results for get queries
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.0.tar.gz
(7.6 kB
view hashes)
Built Distribution
broly-0.1.0-py3-none-any.whl
(5.4 kB
view hashes)