On 4/20/07, Jorge Godoy <[EMAIL PROTECTED]> wrote:
>
> "Gaetan de Menten" <[EMAIL PROTECTED]> writes:
>
> > I fail to understand what you want to do. Do you want to reflect the
> > table from the database or you want it created by Elixir?
> >
> > In the first case, you need to specify the autoload option to your
> > entity, as in:
> >     using_options(autoload=True)
> >
> > In the second case, your code is missing a "create_all()" which will
> > actually create the table in the database.
>
> Can't he explicitly specify column names and use an already existing
> table?  If he can, then his code isn't missing anything.

It could be valid indeed, if the table was created at another
time/elsewhere. But seeing the error he gets, I first thought he
simply didn't create the table... Now that I think of it, the schema
specification seem wrong. It should rather be:

class Customer(Entity):
   has_field('id', Integer, primary_key=True)
   has_field('name', String)
   using_options(tablename='customers')
   using_table_options(schema='cvt')

But I've never used schemas with Elixir, so I'm not sure it works...
It should but... you know...
From what I just read in SQLAlchemy docs, you could also specify the
schema in the connection string...
-- 
Gaƫtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to