[sqlalchemy] table.tometadata() not working with UNIQUE constraints

2007-02-17 Thread Andreas Jung

I have a Table instance with a UniqueConstraint. SA fails while creating
a copy of the table using table.tometadata(). Is there a workaround?

Andreas

-


Traceback (most recent call last):
 File schema.py, line 77, in ?
   M.createTables()
 File schema.py, line 35, in createTables
   for name, table in  DB.getTables().items():
 File 
/home/ajung/sandboxes/mediendb-ajung/HaufeCMS/lib/python/mediendb/haufe/sqlalchemy/postgres/python_wrapper.py, 
line 54, in getTables

   d[name] = table.tometadata(metadata)
 File 
/local2/HRS2/mediendb-ajung/HaufeCMS/lib/python/mediendb/database/schema.py, 
line 303, in tometadata


 File 
/local2/HRS2/mediendb-ajung/HaufeCMS/lib/python/mediendb/database/schema.py, 
line 703, in copy


NotImplementedErro



pgpTD3H1QpFYo.pgp
Description: PGP signature


[sqlalchemy] Support for SQL views?

2007-02-17 Thread [EMAIL PROTECTED]

I've just downloaded and played with SQLAlchemy, and I must say I
quite like it. I've always enjoyed using plain SQL, and SA lets me do
that while integrating nicely with Python. Great work!

But I was a bit disappointed when I found that I couldn't access a
view as a table (using autoload). The application I currently work on
is based on Oracle and uses views heavily. The good news is that it
uses a lot of materialized views, which do work with SA, but it would
still be really nice if SA could treat SQL views as normal tables,
just as the DBMS does. It is also common to use synonyms quite heavily
on Oracle, but SA unfortunately doesn't seem to understand those
either.

Are there are any plans for adding support for this soon?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: sqlalchemy and securtiy

2007-02-17 Thread Manlio Perillo

Michael Bayer ha scritto:
 pretty much.  we use bind parameters for everything literal.  also we
 dont spit out the DB passwords in error messages.  not sure if you
 turn on connection pool logging if some of the DBAPIs put the
 passwords in the __repr__ for their connection objects, thats
 something that could be tested.
 

psycopg2 shows the password in the __repr__, but the problem should be 
fixed now.

http://initd.org/tracker/psycopg/ticket/147



Regards  Manlio Perillo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Support for SQL views?

2007-02-17 Thread vinjvinj

Views as normal tables work with mysql.

 view as a table (using autoload). The application I currently work on


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Support for SQL views?

2007-02-17 Thread Paul Johnston

Hi,

But I was a bit disappointed when I found that I couldn't access a
view as a table (using autoload). The application I currently work on
is based on Oracle and uses views heavily. The good news is that it
  

Views work ok for me using MSSQL, although I haven't tried autoload. My 
gut feel is that if you define an SQLAlchemy table manually that matches 
the view, this will work ok. I suspect it's just autoload that's broken. 
If you can confirm that, it's probably worth filing a bug report.

Paul

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: table.tometadata() not working with UNIQUE constraints

2007-02-17 Thread Michael Bayer

bug, fixed in r2334.  not much of a workaround other than trying to  
append the constraints manually (for which there isnt really a public  
API).

On Feb 17, 2007, at 4:47 AM, Andreas Jung wrote:

 I have a Table instance with a UniqueConstraint. SA fails while  
 creating
 a copy of the table using table.tometadata(). Is there a workaround?

 Andreas

 -


 Traceback (most recent call last):
  File schema.py, line 77, in ?
M.createTables()
  File schema.py, line 35, in createTables
for name, table in  DB.getTables().items():
  File /home/ajung/sandboxes/mediendb-ajung/HaufeCMS/lib/python/ 
 mediendb/haufe/sqlalchemy/postgres/python_wrapper.py, line 54, in  
 getTables
d[name] = table.tometadata(metadata)
  File /local2/HRS2/mediendb-ajung/HaufeCMS/lib/python/mediendb/ 
 database/schema.py, line 303, in tometadata

  File /local2/HRS2/mediendb-ajung/HaufeCMS/lib/python/mediendb/ 
 database/schema.py, line 703, in copy

 NotImplementedErro



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Support for SQL views?

2007-02-17 Thread Michael Bayer


On Feb 17, 2007, at 6:55 AM, [EMAIL PROTECTED] wrote:

 But I was a bit disappointed when I found that I couldn't access a
 view as a table (using autoload). The application I currently work on
 is based on Oracle and uses views heavily. The good news is that it
 uses a lot of materialized views, which do work with SA, but it would
 still be really nice if SA could treat SQL views as normal tables,
 just as the DBMS does.

it does.  however, reflecting those views would require people  
contribute reflection code to all the various DBAPIs.  if the queries  
in oracle.py/reflecttable were enhanced to search for views as well,  
then your app would be able to reflect them.

 It is also common to use synonyms quite heavily
 on Oracle, but SA unfortunately doesn't seem to understand those
 either.

theres a ticket for the issue of oracle reflection across synonyms,  
and a patch within the ticket that needs some reworking before it is  
commtted...the ticket poster marked it as low priority for now.  but  
again, SA has no problem with synonyms, its just reflection youre  
having problems with.  if you define your Tables explicitly (as is  
the only way available with most other ORM tools such as hibernate)  
you can point to any view or synonym you like.




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: py2exe sqlalchemy

2007-02-17 Thread Michael Bayer

if you didnt have to change SA's logging module, its possibly  
because py2.5 has better support for absolute module imports (or  
maybe py2exe does).

On Feb 17, 2007, at 11:58 AM, Ali wrote:


 Hi,

 I might be going insane, but I am successfully using Sqlalchemy
 (0.3.4, Python2.5, py2exe 0.6.6) with py2exe without any problems.

 I did (as suggested) an easy_install --always-unzip to prevent
 having an egg, and then included 'packages': 'sqlalchemy' in the
 options dict for py2exe.

 e.g.

 options = {
 'py2exe' : {
 'packages': 'encodings, sqlalchemy', etc.

 I am waiting for it to explode...

 Ali

 On Feb 9, 4:12 pm, Michael Bayer [EMAIL PROTECTED] wrote:
 add an entry to the FAQ page on the wiki.  possibly with a new FAQ
 category integrating with external tools.

 Oleg Deribas wrote:
 Hello,

 Something Special said the following on 08.02.2007 13:22:

 they should put this help somewhere on main page, or fix it:)

 Michael, would you accept such patch?

 --
 Oleg


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: py2exe sqlalchemy

2007-02-17 Thread Ali

Yes, I imagined something like that. I only posted to avert users from
norcebo effect that they might encounter reading this thread.

On Feb 17, 5:16 pm, Michael Bayer [EMAIL PROTECTED] wrote:
 if you didnt have to change SA's logging module, its possibly
 because py2.5 has better support for absolute module imports (or
 maybe py2exe does).

 On Feb 17, 2007, at 11:58 AM, Ali wrote:



  Hi,

  I might be going insane, but I am successfully using Sqlalchemy
  (0.3.4, Python2.5, py2exe 0.6.6) with py2exe without any problems.

  I did (as suggested) an easy_install --always-unzip to prevent
  having an egg, and then included 'packages': 'sqlalchemy' in the
  options dict for py2exe.

  e.g.

  options = {
  'py2exe' : {
  'packages': 'encodings, sqlalchemy', etc.

  I am waiting for it to explode...

  Ali

  On Feb 9, 4:12 pm, Michael Bayer [EMAIL PROTECTED] wrote:
  add an entry to the FAQ page on the wiki.  possibly with a new FAQ
  category integrating with external tools.

  Oleg Deribas wrote:
  Hello,

  Something Special said the following on 08.02.2007 13:22:

  they should put this help somewhere on main page, or fix it:)

  Michael, would you accept such patch?

  --
  Oleg


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Support for SQL views?

2007-02-17 Thread Michael Bayer

ive committed the patch for synonym reflection in r2335, corresponding
to ticket 379...so a table linked by a synonym should now be
reflectable.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Parameters not handled correctly with adodbapi

2007-02-17 Thread Paul Johnston

Arnar,

I agree that is an adodbapi problem; I have seen this as well. It is 
because adodbapi isn't setting the length of the parameter, so ADO is 
defaulting to 1 - hence you only getting O. I do have an idea how to 
fix this, however I'm choosing not to for now. adodbapi just isn't 
maintained any more - the mailing list is all but dead, and numerous 
attempts to contact the author have failed. Moreover, pyodbc is now a 
very viable alternative. I had been avoid ODBC because earlier versions 
had no Unicode support, but this is now fixed. So, from now I will be 
devoting my energies to making SQLAlchemy work better with pyodbc.

Paul

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Parameters not handled correctly with adodbapi

2007-02-17 Thread Arnar Birgisson

Hi Paul,

Yes, I had found this about the datatype size by way of breaking into
the relevant code and setting the parameter length manually. This made
the query work but just unveiled other problems.

I too made no further efforts to get it work as pymssql works fine for
my purposes - although server side cursors would have been nice to
have. However, the adodbapi module is fairly simple, it's mostly just
proxying to the underlying COM api. I'm pretty sure it's relatively
easy to fix but since I don't have any real need for it myself I lack
the motivation right now. Maybe someday if the DB-API becomes defunct
due to microsoft dropping support for it..

It's good to hear that someone is working on pyodbc support in SA.

Arnar

On 2/17/07, Paul Johnston [EMAIL PROTECTED] wrote:

 Arnar,

 I agree that is an adodbapi problem; I have seen this as well. It is
 because adodbapi isn't setting the length of the parameter, so ADO is
 defaulting to 1 - hence you only getting O. I do have an idea how to
 fix this, however I'm choosing not to for now. adodbapi just isn't
 maintained any more - the mailing list is all but dead, and numerous
 attempts to contact the author have failed. Moreover, pyodbc is now a
 very viable alternative. I had been avoid ODBC because earlier versions
 had no Unicode support, but this is now fixed. So, from now I will be
 devoting my energies to making SQLAlchemy work better with pyodbc.

 Paul

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---