Giter Site home page Giter Site logo

persistent-odbc's Introduction

persistent-odbc

Uses the Persistent package and HDBC-odbc to access databases via ODBC.

Thanks to Dmitry Olshansky at https://github.com/odr/persistent-odbc/ for doing the initial hookup to hdbc-odbc.

Supports Postgres, MySql, MS Sql Server, Oracle, DB2, and SQLite.

see TestODBC.hs for usage and tests.

##How to get started using cabal >= 1.18 git clone https://github.com/gbwey/persistent-odbc cd persistent-odbc cabal sandbox delete cabal sandbox init cabal install --only-dependencies --flags="tester" cabal configure --flags="tester" cabal repl

:load TestODBC.hs  (also need to define the appropriate odbc system dsn below and then run the command)

e.g. for postgresql
    1. define the system odbc dsn pg_test
    2. :main p  
DBMS ODBC System Dsn Command
Postgresql dsn=pg_test :main p
MySQL dsn=mysql_test :main m
DB2 dsn=db2_test :main d
Ms Sql Server >= 2012 dsn=mssql_test; Trusted_Authentication=True; :main s
Ms Sql Server pre 2012 dsn=mssql_test; Trusted_Authentication=True; :main so
Oracle pre 12c dsn=oracle_test :main o
Oracle >= 12c dsn=oracle_test :main on
Sqlite dsn=sqlite_test :main q

####Limit and Offset in Ms Sql Server and Oracle MSSQL True for MS Sql Server 2012 which has limit and offset support (esqueleto as well). MSSQL False for MS Sql Server pre 2012 only supports limit using Persistent's select* operations. (select top n ...).

Oracle True for Oracle >=12c which has limit and offset support (esqueleto as well). Oracle False for Oracle <12c where there is no limit and offset support.

####Ms Sql Server and blobs Blobs don't support nulls (both insert and select) in this version of persistent-odbc (also doesn't work in hdbc-odbc). You may have problems with blobs and latest 2012 odbc driver.

####Ms Sql Server and deleteCascadeWhere Can cause segfault in Ms Sql Server.

####Oracle and nulls Treats empty string as a null (oracle issue).

####Oracle and sorting blobs Cannot sort on a blob field (oracle issue).

####DB2 and blobs Blobs don't support nulls (both insert and select) in this version of persistent-odbc (also doesn't work in hdbc-odbc). Select returns the blob values as unpacked strings at the moment (if there is interest in getting this fixed let me know).

persistent-odbc's People

Contributors

anton-dessiatov avatar darthdeus avatar gbwey avatar marian-jancar avatar odr avatar paulrzcz avatar

Watchers

 avatar  avatar

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.