Skip to main content

sqlalchemy-mimer

A SQLAlchemy 2.x dialect for Mimer SQL, built on top of the PEP 249-compliant driver MimerPy.

🔧 Installation

From source (editable mode)

python -m pip install -e .

Install (PyPi)

python -m pip install sqlalchemy-mimer

🔗 Connection

Supported URL forms

The dialect supports several URI variants:

  • mimer://user:password@database
  • mimer://user:password@host:port/database
  • mimer://user:password@host:port/?dsn=database
  • mimer+mimerpy://user:password@database
  • mimer+mimerpy://user:password@host:port/database
  • mimer+mimerpy://user:password@host:port/?dsn=database

Example:

from sqlalchemy import create_engine

engine = create_engine("mimer://SYSADM:SYSPASS@mimerdb")
engine = create_engine("mimer://SYSADM:SYSPASS@localhost:1360/mimerdb")
engine = create_engine("mimer+mimerpy://SYSADM:SYSPASS@localhost:1360/?dsn=mimerdb")

Note: Until the Mimer SQL C API and MimerPy support host and port parameters, those parts of the URI are parsed but ignored.

▶️ Examples

Run basic demo programs:

python examples/demo_test.py -u <database username> -d <database>
python examples/demo_create_table.py

Run a bit more complete demo that show some of the ORM capabilities:

python examples/demo_orm.py -u <database username> -d <database>

🧪 Running Tests

Before running the tests a Mimer SQL database ident with databank and ident privileges is needed. If no suitable ident exists it can be created with:

create ident TST_MASTER as user using 'TST_MASTER_PWD';
grant ident to TST_MASTER;
grant databank to TST_MASTER with grant option;

To tell the unittests what ident and password to use, set them as environment variables. On Linux and macOS you can do:

export MIMER_TEST_USER=TST_MASTER
export MIMER_TEST_PASSWORD=TST_MASTER_PWD

To run all unittests:

python -m unittest discover tests

Run a specific test file for detailed output:

python tests/test_basic_dml.py
python tests/test_constraints.py
python tests/test_orm.py
.
.
.

Documentation

To build the documentation you have to install mkdocs:

python -m pip install mkdocs mkdocs-material

Build documentation:

mkdocs build

View the generated documentation, run:

mkdocs serve

Alternatively build the docs without flat structure that can be viewed in the browser directly without relying on mkdocs serve:

mkdocs build -f mkdir-nodir.yml

Metadata

Release files for sqlalchemy-mimer 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy-mimer 1.0.4
File Size Uploaded
sqlalchemy_mimer-1.0.4.tar.gz 54.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-mimer 1.0.4
File Interpreter ABI Platform
sqlalchemy_mimer-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 73.1 kB

Release files / sqlalchemy_mimer-1.0.4.tar.gz

Download URL sqlalchemy_mimer-1.0.4.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7e16915991e60f6d1a71c85c754cefa9e6c61d4b0594671d87a73c775047b2b2
BLAKE2b-256 checksum
How to use checksums
f825d3dff39eff9c067d0cb6a326a9fd25d080d549a8ca78e9c74e9a62b3a886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / sqlalchemy_mimer-1.0.4-py3-none-any.whl

Download URL sqlalchemy_mimer-1.0.4-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
516729e59726603cb4f744726450bb80adf731a22e7ebde51939758288df7990
BLAKE2b-256 checksum
How to use checksums
8d2f6235c6e6b3eae8eb5b80e6c2f6d6e8e542ebcb168cb8891b15bc63cf0cd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page