On Feb 28, 2010, at 5:05 PM, Manlio Perillo wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi. > > I recently wrote my first big patch for SQLAlchemy: > http://www.sqlalchemy.org/trac/attachment/ticket/1679/schema.patch > > and I have some questions about the source code. > > * Why objects like Sequence have a `__visit_name__ = 'sequence'`, and > the `visit_sequence` method in the `Compiler` simply returns None? > > If there is nothing to do in the visitor, what is the reason to be > visitable?
try commenting it out and running the tests with PG. it should become clear ! > > * I have noted that some database objects not directly attached to a > metadata, like a Sequence, can leave the database in an inconsistent > state if the associated test suite fails. > > I have the same problem with the Schema object. > If, for some reason, in the test suite there is an error before the > schema is dropped, the successive run of the test suite will fail, > since the test will try to create an already existing schema. > > Is there a good solution? the tests support a --dropfirst option that will remove any errant Table objects. I haven't observed errant sequences to be an issue except perhaps on Oracle, but this system could be enhanced to drop all the sequences too. for testing a CREATE SCHEMA construct I would just check the SQL string and not actually execute anything. unit tests should not create any schemas. see the existing schema-listing tests that just use the three which are part of the documented testing environment. > > > > Thanks Manlio > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkuK6JwACgkQscQJ24LbaURl9ACfV5tcexDnWcNee62MiQaMdkr6 > kVcAoJDEtTt4D1DhNeaTVSA38HYDO5I1 > =EmkU > -----END PGP SIGNATURE----- > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.