A SQL to DynamoDB query wrapper
Project description
Platypus DynamoDB SQL Wrapper
The DynamoDBSQLWrapper is a Python class that provides a SQL-like interface for interacting with Amazon DynamoDB. It allows users to execute SQL-like queries on DynamoDB tables, abstracting away the complexities of DynamoDB's native query language.
Note: This is a work in progress and is not yet ready for production use.
Features
- Execute SELECT, INSERT, UPDATE, and DELETE queries on DynamoDB tables
- Support for basic WHERE clauses
- Basic JOIN functionality (both implicit and explicit joins)
- Parsing of SQL-like queries into DynamoDB operations
- Logging of operations for debugging and monitoring
When would I use this?
This wrapper is useful when you want to use SQL-like syntax to interact with DynamoDB, but you don't want to learn DynamoDB's native query language.
This can be useful when you are migrating from a relational database to DynamoDB, or if you are using DynamoDB as a data store for reporting and business intelligence workloads.
Some legacy applications are built using SQL, and you want to gradually transition to DynamoDB without having to rewrite the queries.
In other cases, businesses may not have the resources to hire a team of DynamoDB experts, and may instead use this wrapper to allow their existing SQL-focused teams to interact with DynamoDB.
Installation
To install the DynamoDBSQLWrapper, use pip:
pip install dynamodb-sql-wrapper
Usage
To use the DynamoDBSQLWrapper, first import and initialize the class:
from dynamodb_sql_wrapper.mysql_to_ddb_class import DynamoDBSQLWrapper
wrapper = DynamoDBSQLWrapper()
Then, you can execute SQL-like queries:
SELECT query
result = wrapper.execute_query("SELECT column1, column2 FROM mytable WHERE column3 = 'value'")
INSERT query
wrapper.execute_query("INSERT INTO mytable (column1, column2) VALUES ('value1', 'value2')")
UPDATE query
wrapper.execute_query("UPDATE mytable SET column1 = 'new_value' WHERE column2 = 'condition'")
DELETE query
wrapper.execute_query("DELETE FROM mytable WHERE column1 = 'value'")
Supported Query Types
- SELECT: Retrieve data from one or more tables
- INSERT: Add new data to a table
- UPDATE: Modify existing data in a table
- DELETE: Remove data from a table
Limitations
- Complex SQL operations and functions are not supported
- JOIN operations are basic and may not cover all use cases
- Performance may vary for large datasets or complex queries
Requirements
- boto3
- Python 3.6+
Note
This wrapper is designed for simplifying DynamoDB operations and may not be suitable for all use cases. It's important to consider the underlying DynamoDB architecture and potential performance implications when using this wrapper in production environments.
Why platypus?
The name "Platypus" was chosen because it is a unique and mythical creature, representing the uniqueness of the DynamoDBSQLWrapper.
When asked for feedback for this project, the first thing that came to mind was "Platypus".
"... it shouldn’t exist, but now that it does it kind of beautiful… even though it’s an abomination ..."
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 dynamodb_sql_wrapper-0.1.0.tar.gz.
File metadata
- Download URL: dynamodb_sql_wrapper-0.1.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00a1d1a1a8b9ec9904794fd29204b94fdc1deb49ef4a969deab1258aa9886cd5
|
|
| MD5 |
278acb406d35df0bf7f46333fe52db42
|
|
| BLAKE2b-256 |
60e85fb4ebe834347c1c08d1d88badd09da9f627f20d3a95221048e64dc94c09
|
File details
Details for the file dynamodb_sql_wrapper-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dynamodb_sql_wrapper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afca22566ef0578ce04b036b1c8f8b81889b3dd29bb20ddccdab29ea3f39ee9c
|
|
| MD5 |
892869ec8266c7c77ae11705132cf3db
|
|
| BLAKE2b-256 |
fe720713111682fae0a0291a516b53159700abdda0615e36cf5f422bd5a74d02
|