Mock Redshift locally by transpiling Redshift SQL to DuckDB and running it.
Project description
rs-mock
A super lightweight, in-process Redshift mocker for test suites.
rs-mock transpiles Redshift SQL to duckdb SQL with sqlglot and runs it against an in-memory duckdb database. No cluster, no network, no Docker — just fast, in-process SQL.
Usage
from rs_mock import RedshiftMock
rs = RedshiftMock()
# DDL / DML — state persists across calls for the instance's lifetime
rs.execute("CREATE TABLE users (id INT, name VARCHAR)")
rs.execute("INSERT INTO users VALUES (1, 'alice'), (2, 'bob')")
# SELECTs, JOINs, CTEs — execute() returns the duckdb cursor
rows = rs.execute("SELECT id, name FROM users ORDER BY id").fetchall()
# [(1, 'alice'), (2, 'bob')]
# Need duckdb power features? Grab the cursor or the connection.
df = rs.execute("SELECT * FROM users").df()
rs.connection # the underlying duckdb connection
Supported: regular selects, joins, CTEs, and DDL/DML. Redshift-specific syntax
(e.g. GETDATE()) is rewritten to its duckdb equivalent automatically.
Development
make test # run tests
make lint # ruff + pyrefly
make prek # pre-commit hooks
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 rs_mock-0.1.0.tar.gz.
File metadata
- Download URL: rs_mock-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91f1195d343a5b9604175d65e09a9a81cc22d92a873cf6f5034ab6c5c64ece6a
|
|
| MD5 |
476151aa2aa171635e816adc8e392e29
|
|
| BLAKE2b-256 |
069fdcd8db240fa8ee7156050fd2973ec39bd92be8c1e95692e0f21f3aa7f1bb
|
Provenance
The following attestation bundles were made for rs_mock-0.1.0.tar.gz:
Publisher:
release-please.yml on tylerriccio33/rs-mock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rs_mock-0.1.0.tar.gz -
Subject digest:
91f1195d343a5b9604175d65e09a9a81cc22d92a873cf6f5034ab6c5c64ece6a - Sigstore transparency entry: 2108506370
- Sigstore integration time:
-
Permalink:
tylerriccio33/rs-mock@b907c99e6c27905e3a8111812d3b18394738995f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tylerriccio33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@b907c99e6c27905e3a8111812d3b18394738995f -
Trigger Event:
push
-
Statement type:
File details
Details for the file rs_mock-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rs_mock-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 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 |
3ce2e47329f13f59b75de33de5d85b6ee592818bb5a02f599a1b0cc7ebb2b9ce
|
|
| MD5 |
4074d6b3a172670f8d2c24f169655801
|
|
| BLAKE2b-256 |
1131cee5269413e2e55377f6fdb7b774015e4aa7525a9c8427aef475e8fd8552
|
Provenance
The following attestation bundles were made for rs_mock-0.1.0-py3-none-any.whl:
Publisher:
release-please.yml on tylerriccio33/rs-mock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rs_mock-0.1.0-py3-none-any.whl -
Subject digest:
3ce2e47329f13f59b75de33de5d85b6ee592818bb5a02f599a1b0cc7ebb2b9ce - Sigstore transparency entry: 2108506573
- Sigstore integration time:
-
Permalink:
tylerriccio33/rs-mock@b907c99e6c27905e3a8111812d3b18394738995f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tylerriccio33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@b907c99e6c27905e3a8111812d3b18394738995f -
Trigger Event:
push
-
Statement type: