On 30 May 2006 at 21:05, Michael Bayer wrote:

Copies to:              sqlalchemy-users 
<sqlalchemy-users@lists.sourceforge.net>
From:                   Michael Bayer <[EMAIL PROTECTED]>
Subject:                Re: [Sqlalchemy-users] Better Firebird patch and test 
patches
Date sent:              Tue, 30 May 2006 21:05:26 -0400
To:                     Brad Clements <[EMAIL PROTECTED]>

> ok what do you want here, dbengine://user:[EMAIL PROTECTED]:port/database?
> opt=val&opt=val ?  as long as its good with RFC1738.  did you send me 
> a patch ?  i lost track today.  also how do you want to approach name 
> conflicts between databases ?  do you want to prefix each name with 
> the drivername ?  otherwise those URLs are still not agnostic.

I did not send a patch. I'm looking at the regex in url._parse_rfc1738_args and 
trying to decide if I can just change it to..

    pattern = re.compile(r'''
            (\w+)://
            (?:
                ([^:]*)
                (?::(.*))?
            @)?
            (?:
                ([^/:]*)
                (?::([^/]*))?
            )?
            (?:/[^?]*)?
            (?:?(.*))?
            '''
            , re.X)

Not sure if I grok the pattern here correctly, but basically saying that the 
database 
part can have anything except '?'  
and add a new optional group that comes after a '?'

then, if that match is true, that part will be passed through cgi.parse_qsl and 
the 
resultant dict stuck into the URL object as .. 'extra_args' or something like 
that.

Regarding prefixing these extra args.. I don't see why that'd be necessary, 
since 
engines would have to pull out whatever args they're looking for from the URL 
object, and an engine is only going to get args for which it was the named 
'scheme' in the uri anyway.

so if two engines each look for a  '?init=True', I can't see how that matters.



> all 273 tests in the trunk at the moment pass on mysql, postgres, and 
> sqlite.  tests that arent supported for a certain DB (like sequences 
> for mysql) have an "unsupported" decorator for that database, so they 
> pass too.    so for any test, if for example 'sqlite' is not marked 
> as unsupported, then that test passes on sqlite.  if not, then 
> something weird is going on, maybe your version of sqlite or 
> something about the windows environment (i havent run the tests on 
> windows in many weeks, perhaps its time to do that).

well, test/select.py fails as follows, I don't see any engine calls there or 
any 
firebird.py on the stack (wondering why postgres.dialect() is in there.


======================================================================
FAIL: testcast (__main__.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\select.py", line 551, in testcast
    check_results(postgres.dialect(), ['NUMERIC(10, 2)', 'NUMERIC(12, 9)', 'DATE
', 'TEXT', 'VARCHAR(20)'], '%(literal)s')
  File "test\select.py", line 546, in check_results
    self.assertEqual(str(cast(1234, TEXT).compile(dialect=dialect)), 'CAST(%s AS
 %s)' %(literal, expected_results[3]))
AssertionError: 'CAST(:literal AS TEXT)' != 'CAST(%(literal)s AS TEXT)'

======================================================================
FAIL: testouterjoin (__main__.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\select.py", line 484, in testouterjoin
    dialect=postgres.dialect()
  File "test\select.py", line 59, in runtest
    self.assert_(cc == result, str(c) + "\n does not match \n" + result)
AssertionError: SELECT mytable.myid, mytable.name, mytable.description, myothert
able.otherid, myothertable.othername
FROM mytable LEFT OUTER JOIN myothertable ON mytable.myid = myothertable.otherid

WHERE mytable.name = :mytable_name AND mytable.myid = :mytable_myid AND myothert
able.othername != :myothertable_othername AND EXISTS (select yay from foo where
boo = lar)
 does not match
SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, my
othertable.othername FROM mytable LEFT OUTER JOIN myothertable ON mytable.myid =
 myothertable.otherid WHERE mytable.name = %(mytable_name)s AND mytable.myid = %
(mytable_myid)s AND myothertable.othername != %(myothertable_othername)s AND EXI
STS (select yay from foo where boo = lar)

======================================================================
FAIL: testtextbinds (__main__.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\select.py", line 305, in testtextbinds
    dialect=dialect
  File "test\select.py", line 59, in runtest
    self.assert_(cc == result, str(c) + "\n does not match \n" + result)
AssertionError: select * from foo where lala=:bar and hoho=:whee
 does not match
select * from foo where lala=%(bar)s and hoho=%(whee)s

----------------------------------------------------------------------
Ran 39 tests in 0.125s

FAILED (failures=3)





-- 
Brad Clements,                [EMAIL PROTECTED]    (315)268-1000
http://www.murkworks.com                          
AOL-IM or SKYPE: BKClements




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to