Skip to main content

An InterSystems IRIS dialect for SQLAlchemy

Project description

sqlalchemy-intersystems-iris

This package provides an InterSystems IRIS dialect for SQLAlchemy, built for use with the InterSystems Python DB-API driver.

Installation

Install sqlalchemy-intersystems-iris with pip:

pip install sqlalchemy-intersystems-iris

The InterSystems Python DB-API driver is a dependency and will be automatically installed or upgraded to a compatible version.

Usage

You can connect your Python application to an InterSystems IRIS database by passing a connection URL to create_engine(). The URL can be a string or a SQLAlchemy URL object.

A connection string for InterSystems IRIS has the format iris://{username}:{password}@{host}:{port}/{namespace}. For example:

from sqlalchemy import create_engine

url = "iris://SQLUser:password@localhost:1972/USER"

engine = create_engine(url)

You can construct a SQLAlchemy URL with URL.create(). Note that the database field corresponds to an InterSystems IRIS namespace:

from sqlalchemy import create_engine
from sqlalchemy import URL

url = URL.create(
    drivername='iris',
    username='SQLUser',
    password='password',
    host='localhost',
    port=1972,
    database='USER',
)

engine = create_engine(url)

As these examples demonstrate, you do not need to import the dialect package directly — the SQLAlchemy engine will automatically load the correct dialect based on the connection URL.

For details on the features supported by InterSystems IRIS SQL, see the InterSystems IRIS SQL documentation.

Documentation

For more information on how to use SQLAlchemy with InterSystems IRIS, see this overview. The full SQLAlchemy documentation is available at https://docs.sqlalchemy.org/.

Help

For any issues you can contact InterSystems Worldwide Response Center (WRC).

License

This project is licensed under the terms detailed at https://www.intersystems.com/IERTU/.

This project includes code derived from sqlalchemy-iris.

Copyright (c) 2021 Dmitry Maslenikov

The following license applies to that code:

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Release Notes

Version 1.0.1

Minor updates to documentation and package metadata.

Version 1.0.0

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlalchemy_intersystems_iris-1.0.1-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy_intersystems_iris-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_intersystems_iris-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd038ce7143797ce8a3eb49008b37f3e3db3425749ed2702beb561d262235ba6
MD5 88a08c2be11fe247970b051725d6c58c
BLAKE2b-256 db0e5d8c875a6c2e54ff430c3f4581bbcf3f31b360760d1c15e46834ba9400f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page