Code Monkey home page Code Monkey logo

sqlalchemy_exasol's Introduction

SQLAlchemy Dialect for EXASOL DB

https://travis-ci.org/blue-yonder/sqlalchemy_exasol.svg?branch=master https://coveralls.io/repos/blue-yonder/sqlalchemy_exasol/badge.png Requirements Status

This is an SQLAlchemy dialect for the EXASOL database.

How to get started

We assume you have a good understanding of (unix)ODBC. If not, make sure you read their documentation carefully - there are lot's of traps to step into.

Get the EXASolution database

If you do not have access to an EXASolution database, download EXASolo for free from EXASOL: http://www.exasol.com/en/test-drive/

The database is a VM image. You will need VirtualBox, VMWare Player, or KVM to run the database. Start the database and make sure you can connect to it as described in the How-To from EXASOL.

Meet the system requirements

On Linux/Unix like systems you need:

  • the packages unixODBC and unixODBC-dev >= 2.2.14
  • Python >= 2.7
  • Download and install the ODBC client drivers from EXASOL >= 4.2
  • configure ODBC.ini and ODBCINST.ini

Setup you python project and install sqlalchemy-exasol

> pip install sqlalchemy-exasol

Talk to EXASolution using SQlAlchemy

from sqlalchemy import create_engine
e = create_engine("exa+pyodbc://A_USER:[email protected]:1234/my_schema")
r = e.execute("select 42 from dual").fetch_all()

The dialect supports two connection urls for create_engine. A DSN (Data Source Name) mode and a host mode:

DSN url 'exa+pyodbc://USER:PWD@exa_test'
Host url 'exa+pyodbc://USER:[email protected]:1234/my_schema?parameter'

Note:

  • Schema name and parameters are optional for the host url string
  • Always use all lower-case identifiers for schema, table and column names. SQLAlchemy treats all lower-case identifiers as case-insensitive, the dialect takes care of transforming the identifier into a case-insensitive representation of the specific database (in case of EXASol this is upper-case as for Oracle)
  • As of EXASol client driver version 4.1.2 you can pass the flag 'INTTYPESINRESULTSIFPOSSIBLE=y' in the connection string (or configure it in your DSN). This will convert DECIMAL data types to Integer-like data types. Creating integers is a factor three faster in Python than creating Decimals.

Troubleshooting

The unixodbc Stack is not the most friendly for programmers. If you get strange errors from the driver mangager, you might have an issue with the names of the unixodbc libs. Have a look at https://github.com/blue-yonder/sqlalchemy_exasol/blob/master/fix_unixodbc_so.sh to find ideas on how to fix this on Ubuntu. Good luck!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.