im not really following migrate so much but you can get in touch with  
its author Evan.

you can check for tables directly by calling engine.dialect.has_table 
(tablename)  (which needs to have a "schema" keyword argument and  
appripriate SQL added to each DB module, more or less finishing #233...)

On Aug 6, 2006, at 3:38 AM, Tzahi Fadida wrote:

> On Sunday 06 August 2006 06:04, Michael Bayer wrote:
>> ah yeah the first would be fixed by ticket #233, i.e. a TODO.
>
> Well, it is very difficult to work with schemas without fixing 233,
> because even if i will write a ddl manipulator using plain sql  
> statements i
> still have to detect this.
>
> Is there a way to check for the existance of a schema
> or a table for that matter (without create_all)?
> Is there a facility in metadata to access the list of tables it  
> manages?
>
> What is the status of the SOC migration project, i know my own SOC  
> project
> is finished (and all should be finished soon
> http://code.google.com/soc/studentfaq.html#timeline).
> If the migration project is usable then it might be a good  
> replacement for
> programatically doing ddl operations in my framework.
>
> 10x.
>
>>
>> for the second, we currently dont have any support for CREATE SCHEMA,
>> (nor do we have things like ALTER, CREATE VIEW, stored procedure
>> management, etc).  the create/drop/reflection capabilities of SA are
>> meant for small, self-packaging applications and assumes that more
>> sophisticated schemas would be created by DDLs or real schema
>> management applications.
>>
>> not that SA will never support CREATE SCHEMA, but its lower priority
>> since not every DB even supports CREATE SCHEMA and also SA is not
>> trying to be a replacement for DDLs.
>>
>> On Aug 5, 2006, at 6:11 PM, Tzahi Fadida wrote:
>>> I am using postgresql.
>>> When i use the schema keyword in Table(),
>>> if there is already a table with the same name in
>>> the "public"/default schema then metadata.create_all()
>>> assumes the schema (other than public) and table already exists.
>>> I.e. instead of checking in the requested schema it uses "public".
>>>
>>> The second bug, is if i now drop the table from the "public" schema
>>> and do metadata.create_all(), sqlalchemy does not attempt to create
>>>
>>> the schema before creating the table and throws a ProgrammingError:
>>>>>> metadata.create_all()
>>>
>>> [2006-08-06 00:53:12,228] [engine]: select relname from pg_class  
>>> where
>>> lower(relname) = %(name)s
>>> [2006-08-06 00:53:12,229] [engine]: {'name': 'users'}
>>> [2006-08-06 00:53:12,237] [engine]:
>>> CREATE TABLE nis2.users (
>>>         user_id SERIAL NOT NULL,
>>>         user_name VARCHAR(40),
>>>         password VARCHAR(10),
>>>         PRIMARY KEY (user_id)
>>> )
>>>
>>>
>>> [2006-08-06 00:53:12,238] [engine]: None
>>> [2006-08-06 00:53:12,249] [engine]: ROLLBACK
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in ?
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/schema.py", line  
>>> 768, in
>>> create_all
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 456, in
>>> run_callable
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/schema.py", line 767,
>>> in do
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 298, in
>>> create
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 399, in
>>> create
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 423, in
>>> _run_visitor
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/schema.py", line  
>>> 209, in
>>> accept_schema_visitor
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/ansisql.py", line
>>> 639, in
>>> visit_table
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 685, in
>>> execute
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 354, in
>>> proxy
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 319, in
>>> _execute_raw
>>>   File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line
>>> 338, in
>>> _execute
>>> sqlalchemy.exceptions.SQLError: (ProgrammingError) schema "nis2"
>>> does not
>>> exist
>>>  '\nCREATE TABLE nis2.users (\n\tuser_id SERIAL NOT NULL, \n
>>> \tuser_name
>>> VARCHAR(40), \n\tpassword VARCHAR(10), \n\tPRIMARY KEY (user_id)\n)
>>> \n\n' {}
>>>
>>> --
>>> Regards,
>>>         Tzahi.
>>> --
>>> Tzahi Fadida
>>> Blog: http://tzahi.blogsite.org | Home Site: http:// 
>>> tzahi.webhop.info
>>> WARNING TO SPAMMERS:  see at
>>> http://members.lycos.co.uk/my2nis/spamwarning.html
>>>
>>> -------------------------------------------------------------------- 
>>> --
>>> ---
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to
>>> share your
>>> opinions on IT & business topics through brief surveys -- and earn
>>> cash
>>> http://www.techsay.com/default.php?
>>> page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> Sqlalchemy-users mailing list
>>> Sqlalchemy-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>
> -- 
> Regards,
>         Tzahi.
> --
> Tzahi Fadida
> Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
> WARNING TO SPAMMERS:  see at
> http://members.lycos.co.uk/my2nis/spamwarning.html
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys -- and earn  
> cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to