On Jan 29, 2013, at 10:48 AM, jank wrote: > thank you for your time and patience. Again the hints were very useful. > > The dialect I am implementing is syntactically very similar to Oracle (this > was done on purpose) but the semantics are quite different. For example, > schema changing operations are transactional. Thus, a rollback will also > rollback a table create.
that's a good thing. transactional DDL makes things easier and the tests are all compatible with that. > > My has_table() function does indeed has a problem. EXASol does not have a > default schema, but not selecting a schema can cause unwanted results. Thus I > have decided to make 'SYS' the default schema for the dialect and I do expect > that every user of the dialect passes a non None schema. The test cases is > not consistently passing the schema name. the usual way the Table construct works is without a "schema" name. That's why dialects have a "default schema name" - it means the schema that is used if you were to connect to the database and just do a "CREATE TABLE sometable ...", what schema would "sometable" be created within ? SQLAlchemy doesn't enforce the awkwardness of needing to specify this schema when an application is only working within the "default" schema. > > Again, recommendations on what is expected of a dialect would be useful. I > would prefer to always have a schema name passed. Otherwise schema reflection > functions like has_table() return unwanted results the query inside has_table() usually does have to determine what schema name should be used when it looks for tables. It should be whatever schema is active, as though you had just connected to the database and created the table without specifying any schema. This detail is left unexposed to the Table object. Only if the Table *does* actually specify "schema", then you work in "explicit schema" mode. But usually getting "implicit schema" to work first is the order to go. > (as tables with the same name can exist in two different schemas). Is that a > valid pre-condition for a dialect? Is the test suite expected to pass the > schema name in all test cases? the "with schemaname" tests are actually the exception cases. Not every backend supports them (though most do at this point). -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
