Alexandre CONRAD wrote:
> I can see that the "hidden=True" argument is available for a Column
> object. But using this argument doesn't seem to make the table function
> in any good maner.

the "hidden" keyword is only meant for internal usage when generating
an "oid" column, which is a quasi-real column that corresponds to the
databases "oid", "ROWID", or equivalent column, if any.  I will rename
"hidden" to "_hidden" (or maybe even "_is_oid") since its not meant for
public usage.  a database column generally has no concept of "hidden"
so therefore Column should not either - the "hidden" flag that exists
is an artifact of the "oid" implementation in SA.

if youre looking to represent form metadata in relation to tables, I
believe that warrants its own kind of object, which contains one or
more Tables/Columns internally if thats what its doing, but provides
attributes and behavior that is relevant to an HTML form; since
"hidden" is far from the only concept that a form may have which a
database table does not.

> Also, I was wondering how I could parse an SA table to see which column
> is a primary_key *AND* is a auto increment (a suggorate key). It seems
> that SA sends a SQL AUTO_INCREMENT command at the table creation when a
> column is set as a primary_key and is an Integer type. Which I think is
> not the right behaviour. I think we should be able to explicitly say
> that a Column is an Integer and have some "auto_inc=True" argument
> available somewhere.

the appending of "AUTO_INCREMENT" or "SERIAL" is specific to mysql and
postgres, two databases that support a column-level keyword to indicate
automatic sequence generation, and no keyword is generated in the case
of sqlite, oracle, firebird, and maybe MS-SQL which I am less familiar
with; so whether or not a keyword is generated is specific to the
database dialect being used.

Column also has a flag "autoincrement=True" in the trunk which when set
to false will disable automatic generation of auto-incrementing DDL
language, if any was supported by the database in the first place.

> I'm new to databases and only had experiments with MySQL. I don't know
> if other databases use suggorate keys other than INT types.

autoincrementing behavior is only applied to integer column types.

> This is just a feel from outside. I haven't got into the SA source code
> to see how it all works together.

I welcome you to dig in the soucre code as much as possible, just make
sure that you always deal with the trunk, since the code in 0.2.8 is
ancient history as far as I'm concerned ;)


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to