[IronPython] sqlalchemy + sqlite on ironpython
Harry Percival
harry.percival at gmail.com
Mon Apr 19 17:20:04 CEST 2010
Hi Jeff,
I just this minute wrote you an email via bitbucket. I am having some
initial success with your adonet-dbapi - I had bumped into trouble
with the fact that the connection strings need to look different from
the standard cpython ones.
For anyone else interested: standard sqlalchemy/cpython/sqlite3
syntax would be:
>>> from sqlalchemy import *
>>> engine = create_engine('sqlite:///foo.db3', echo=True)
>>> metadata = MetaData()
>>> users_table = Table('users', metadata,
... Column('id', Integer, primary_key=True),
... Column('name', String),
... Column('fullname', String),
... Column('password', String)
... )
>>> metadata.create_all(engine)
amended syntaxt if using Jeff's System.Data.Sqlite wrapper
>>> engine = create_engine('sqlite:///data source=foo2.db3', echo=True)
I'll take a look at your 'pure' sqlite implementation now... thanks again!
hp
On Mon, Apr 19, 2010 at 5:13 PM, Jeff Hardy <jdhardy at gmail.com> wrote:
> Hi Harry,
> Two other options that I know of:
>
> 1) IronPython.Sqlite (http://bitbucket.org/jdhardy/ironpython.sqlite):
> This is a pure managed implementation with no external dependencies
> but it's not complete.
>
> 2) A wrapper around System.Data.Sqlite:
> http://bitbucket.org/jdhardy/adonet-dbapi. A slightly older version of
> this is in the FePy trunk. This is only a partial implementation as
> well.
>
> I think #1 is the better long-term option because System.Data.Sqlite
> (#2) isn't capable of supporting all of Python's sqlite3 module and is
> thus a bit of a dead end. I don't know which of the two is actually
> more capable currently, though.
>
> - Jeff
>
> On Sun, Apr 18, 2010 at 10:39 AM, Harry Percival
> <harry.percival at gmail.com> wrote:
>> Hey all,
>>
>> trying to get SQLAlchemy + SQLite working on IronPython. Any tips?
>>
>> I think SQLAlchemy is installing OK, but slqite seems to be the real
>> stumbling block. Here's what I've tried so far:
>>
>> 1/ use cpython sqlite via Ironclad: doesn't work (
>> http://code.google.com/p/ironclad/issues/detail?id=19 )
>> 2/ fepy version of sqlite: unable to import dbapi2 from sqlite
>> 3/ using dist-tools to install pysqlite2 on ipy - falls over with
>> 'need visual studio 6.0 compiler' error
>> 4/ manually copying 'stuff' from c:\Python26\Lib to IronPython lib
>> folder - not working (as you can tell from the use of the word
>> 'stuff', i clearly don't really know what i'm doing here)
>>
>> suggestions gratefully appreciated!
>>
>> rgds,
>> Harry
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
--
------------------------------
Harry J.W. Percival
------------------------------
Italy Mobile: +39 389 095 8959
UK Mobile: +44 (0) 78877 02511 (may be turned off)
Skype: harry.percival
Email: harry.percival at gmail.com
More information about the Ironpython-users
mailing list