On Feb 28, 2011, at 9:05 AM, David Borsodi wrote:
> Hello,
>
> I'm trying to run the following query with elixir entities:
>
> elixir.metadata.bind = 'mysql://root:root@localhost/mutdb'
> elixir.metadata.bind.echo = True
> elixir.setup_all(True)
>
> t = text("select * from mutations")
> result = elixir.session.connection().execute(t)
>
> and I got:
> sqlalchemy.exc.UnboundExecutionError: This session is not bound to a
> single Engine or Connection, and no context was provided to locate a
> binding.
>
> I though elixir does all the initialization with setup_all(), what
> else is needed to run queries like this?
> Normal mapped queries like Mutation.query.all() work normally.
I would have thought Elixir associates the engine with the Session, if not you
may ask on their list.
You can associate the contextual session (i.e. , a ScopedSession wrapper) with
a bind by doing:
session.configure(bind=engine)
before the contextual session is first used.
--
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.