Manlio Perillo wrote:
>
> PoolListener is rather low level; if I use them I need to know in
> advance the secondary databases to attach.
What precisely is the use case for an application that will use a database
X, will be using remote schemas P, Q, and R, but its unreasonable for
those schemas P, Q and R to be configured along with the database
connectivity ? I see an easy feature add to the SQLite dialect that would
allow:
create_engine('sqlite:///X.db', schemas=['p', 'q', 'r'])
Alternatively, I can even see using connection options for this, if you
want to attach to those schemas per connection:
conn = engine.connect().execution_options(sqlite_attach_schemas=['p', 'q',
'r'])
>
>>
>>> I think that this behaviour is incorrect.
>>> The "before-create" listeners of a MetaData object should be called
>>> before checking if the tables exist.
>>
>> I can see the awkardness here but the current contract of
>> "before-create"
>> is that it means "before I create this list of Tables that I have found
>> need creation, and here they are". Its something we may have to
>> revisit
>> if there's really a reason for a "before I do anything" hook - but I
>> don't
>> buy the case of "I need to attach schemas in the create_all()" as a
>> necessary use case.
>
> Ok, fine for me.
> Auto attach database for SQLite it's not something i really need and it
> can still can be implemented using a PoolListener.
>
> See my reply to the more recent thread about Schema in SQLAlchemy about
> the reason why I was assuming that changing current behaviour was fine.
>
>
>
> Regards Manlio
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAktxNRIACgkQscQJ24LbaURRdACcCj51Sb5Gp1cqZNDUv3U6zM1Y
> LKgAn35CBel2vOrfkCd4yK5XMVMFf+V/
> =xBEd
> -----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 [email protected].
> 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.
>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.