How do I use ibm_db_sa?
GoogleCodeExporter opened this issue · 6 comments
GoogleCodeExporter commented
What steps will reproduce the problem?
1. install sqlalchemy
2. install ibm_db
3. install ibm_db_sa
4. import sqlalchemy; sqlalchemy.create_engine('ibm_db_sa:///') ->
ImportError: unknown database 'ibm_db_sa'
Original issue reported on code.google.com by pyalot@gmail.com
on 14 Feb 2008 at 10:39
GoogleCodeExporter commented
SQLAlchemy exposes a 'sqlalchemy.databases' setuptools entry point for external
dialects. ibm_db_sa needs its own package namespace and an entry_points
section in
its setup.py to be usable by sa.
Original comment by jason.ki...@gmail.com
on 15 Feb 2008 at 2:46
GoogleCodeExporter commented
Agreed.
We'll make use of the 'sqlalchemy.databases' setuptools entry point and fix
namespace
and an entry_points section in the setup.py. Thanks for providing additional
clarification.
Original comment by apiti...@ca.ibm.com
on 15 Feb 2008 at 2:54
GoogleCodeExporter commented
Internal defect #154259 opened.
Original comment by apiti...@ca.ibm.com
on 15 Feb 2008 at 2:45
- Changed state: Accepted
- Added labels: Component-Scripts, Usability
GoogleCodeExporter commented
I believe we've cleaned up the .egg setup mess from the first code drop, but if
you
find the "broom missed some filthy corner", please let us know :-)
Now the attempt to install remotely IBM_DB_SA adapter should behave as below:
$ sudo easy_install ibm_db_sa
Searching for ibm-db-sa
Reading http://pypi.python.org/simple/ibm_db_sa/
Reading http://code.google.com/p/ibm-db/downloads/list
Best match: ibm-db-sa 0.1.1
Downloading http://ibm-db.googlecode.com/files/ibm_db_sa-0.1.1-py2.5.egg
Processing ibm_db_sa-0.1.1-py2.5.egg
creating /usr/lib/python2.5/site-packages/ibm_db_sa-0.1.1-py2.5.egg
Extracting ibm_db_sa-0.1.1-py2.5.egg to /usr/lib/python2.5/site-packages
Adding ibm-db-sa 0.1.1 to easy-install.pth file
Installed /usr/lib/python2.5/site-packages/ibm_db_sa-0.1.1-py2.5.egg
Reading http://pypi.python.org/pypi/ibm_db/
Reading http://pypi.python.org/pypi/SQLAlchemy/
Processing dependencies for ibm-db-sa
Searching for ibm-db>=0.2.5
Best match: ibm-db 0.2.6
Downloading http://ibm-db.googlecode.com/files/ibm_db-0.2.6-py2.5-linux-i686.egg
Processing ibm_db-0.2.6-py2.5-linux-i686.egg
creating /usr/lib/python2.5/site-packages/ibm_db-0.2.6-py2.5-linux-i686.egg
Extracting ibm_db-0.2.6-py2.5-linux-i686.egg to /usr/lib/python2.5/site-packages
Adding ibm-db 0.2.6 to easy-install.pth file
Installed /usr/lib/python2.5/site-packages/ibm_db-0.2.6-py2.5-linux-i686.egg
Finished processing dependencies for ibm-db-sa
We also provided some simple sanity test in the README to verify once installed:
http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_sa/README
Bring up Python console and input:
import sqlalchemy
from sqlalchemy import *
import ibm_db_sa.ibm_db_sa
db2 = sqlalchemy.create_engine('ibm_db_sa://userid:secret@host.name.com:50000/pydev')
metadata = MetaData()
users = Table('users', metadata,
Column('user_id', Integer, primary_key = True),
Column('user_name', String(16), nullable = False),
Column('email_address', String(60), key='email'),
Column('password', String(20), nullable = False)
)
metadata.bind = db2
metadata.create_all()
users_table = Table('users', metadata, autoload=True, autoload_with=db2)
users_table
Original comment by apiti...@ca.ibm.com
on 16 Feb 2008 at 4:30
- Changed state: Fixed
GoogleCodeExporter commented
I can confirm that this is fixed now. thx a lot.
Original comment by pyalot@gmail.com
on 16 Feb 2008 at 8:38
GoogleCodeExporter commented
Original comment by abhigyan...@in.ibm.com
on 28 Apr 2008 at 2:31
- Changed state: Verified