Netezza Performance Server

 View Only

Announcing nzalchemy: SQLAlchemy dialect for Netezza database engine

By Abhishek Jog posted Mon December 21, 2020 07:44 AM


Accessing Netezza through SQLAlchemy using nzalchemy dialect

Now Python developers can write Python applications which access Netezza Performance Server using SQLAlchemy toolkit along with nzalchemy dialect.

SQLAlchemy has gained popularity among Python programmers who work with databases. A major benefit which developer gets by using SQLAlchemy, as against traditional database drivers like ODBC, is that it allows them to map database schema to Python objects in the application code.

IBM has now developed and opensourced SQLAlchemy dialect for Netezza Performance Server. The dialect is available on PyPi and should be installed as pip install nzalchemy. This also installs SQLAlchemy as a dependency.

With this, instead of writing SQL queries in application code such as:

SELECT * FROM customer

Application code with nzlachmey looks as if you are accessing table as an object in your code. Start using nzalchemy with:

import nzalchemy

Code for “select all records from table” reads:

customers = customer.query.all()

nzalchemy dialect depends on pyodbc at the core.

IBM encourages developer community to contribute to this project and also open issues and feature requests. For more information, refer documentation