[TransWarp] SqliteURL returns FileFactory?

Phillip J. Eby pje at telecommunity.com
Mon Aug 11 17:00:29 EDT 2003


At 01:33 PM 8/11/03 -0700, John Landahl wrote:
>Hello, all.  A while back (a month ago?) I had some DMs working with both
>Postgres and Sqlite.  Now that I need to actually use the DMs it seems that
>the changes made around July 16th having to do with adaptTo/defaultFactory
>may have broken Sqlite-based URL functionality.  Either that or I just don't
>understand how a database object should be constructed now.  Unfortunately
>the Bulletins example hasn't been updated yet to work correctly since the
>changes,  so there's no help there ('bulletins createdb' is now broken, for
>example).
>
>Here's how I'm trying to create a database object:
>
>   db = binding.Once(
>     lambda self, d, a: self.lookupComponent('sqlite:foo.db')
>   )

Interesting.  I'm not sure why that's causing you a problem, but the 
simplest way to do the above is:

     db = binding.bindTo('sqlite:foo.db')



>So it seems the URL 'sqlite:foo.bar' results in a FileFactory object (just
>verified this with N2) -- shouldn't it be a SqliteConnection object?

Strange; I just tried running 'peak n2 sqlite:foo.bar', and I get an SQL 
interaction prompt.


>Out of curiosity I just tried to lookup a "pgsql:" URL in N2 and got an
>AttributeError: 'GenericSQL_URL object has no attribute 'defaultFactory'
>
>Is this a bug, or am I missing something?

Now that's *really* odd.  Can you run the main test suite and see what 
results you get?




More information about the PEAK mailing list