[sqlalchemy] Re: Creating column comments on the database

2008-06-05 Thread Christoph Zwerschke

Lukasz Szybalski schrieb:
 I think I prefer info dictionary rather then a string. Dict info
 which I use already have something like this:
 
  sqlalchemy.Column('DRIVE_TRAIN',  sqlalchemy.Unicode(4)
 ,info={description:DRIVE TRAIN TYPE [AWD,4WD,FWD,RWD]}),
  sqlalchemy.Column('FUEL_SYS', sqlalchemy.Unicode(4)
 ,info={description:FUEL SYSTEM CODE,
  FI:FUEL INJECTION,
  TB:TURBO}),

I think you're mixing different things here. What I suggested was 
support of the database comment statement/clause supported by all major 
databases (except maybe SQL Server).

What you're looking for seems to be something similar to the Domain 
feature of the old Oracle Designer,

http://marceloverdijk.blogspot.com/2008/05/ref-code-plugin.html
http://its.unm.edu/ais/docs/oradomains.htm

This would be an interesting extension as well. Should be possible with 
a custom TypeDecorator or TypeEngine.

-- Christoph

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Creating column comments on the database

2008-06-05 Thread Lukasz Szybalski

On Thu, Jun 5, 2008 at 2:37 AM, Christoph Zwerschke [EMAIL PROTECTED] wrote:

 Lukasz Szybalski schrieb:
 I think I prefer info dictionary rather then a string. Dict info
 which I use already have something like this:

  sqlalchemy.Column('DRIVE_TRAIN',  sqlalchemy.Unicode(4)
 ,info={description:DRIVE TRAIN TYPE [AWD,4WD,FWD,RWD]}),
  sqlalchemy.Column('FUEL_SYS', sqlalchemy.Unicode(4)
 ,info={description:FUEL SYSTEM CODE,
  FI:FUEL INJECTION,
  TB:TURBO}),

 I think you're mixing different things here. What I suggested was
 support of the database comment statement/clause supported by all major
 databases (except maybe SQL Server).

I see.


 What you're looking for seems to be something similar to the Domain
 feature of the old Oracle Designer,

I wonder if it was possible to save the info field {} I showed above
via the comment statement/clause you are mentioning if it gets
implemented?

This would really help in describing business rules and descriptions
of each column.
Lucas





 http://marceloverdijk.blogspot.com/2008/05/ref-code-plugin.html
 http://its.unm.edu/ais/docs/oradomains.htm

 This would be an interesting extension as well. Should be possible with
 a custom TypeDecorator or TypeEngine.

 -- Christoph

 




-- 
Automotive Recall Database. Cars, Trucks, etc.
http://www.lucasmanual.com/recall/
TurboGears Manual-Howto
http://lucasmanual.com/pdf/TurboGears-Manual-Howto.pdf

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Creating column comments on the database

2008-06-04 Thread Michael Bayer

at the very least you could use per-table DDL() with an ALTER to  
apply it after the fact...


On Jun 4, 2008, at 8:41 AM, Christoph Zwerschke wrote:


 Does SQLAlchemy support comment on column or comments on other
 database objects? I expected Column to have a comment keyword, but  
 found
 nothing of that kind. Maybe I am missing something?

 I find column comments often useful, and though they may not be SQL
 standard, they are supported by all major databases.

 -- Christoph

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Creating column comments on the database

2008-06-04 Thread Lukasz Szybalski

On Wed, Jun 4, 2008 at 7:41 AM, Christoph Zwerschke [EMAIL PROTECTED] wrote:

 Does SQLAlchemy support comment on column or comments on other
 database objects? I expected Column to have a comment keyword, but found
 nothing of that kind. Maybe I am missing something?

 I find column comments often useful, and though they may not be SQL
 standard, they are supported by all major databases.


I started using info dict on a column names in sa file definitions. It
would be nice to save it to db if once could.  What db supports
comments and what table name is it?

Lucas

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Creating column comments on the database

2008-06-04 Thread Christoph Zwerschke

Lukasz Szybalski schrieb:
 I started using info dict on a column names in sa file definitions. It
 would be nice to save it to db if once could.  What db supports
 comments and what table name is it?

Oracle and PostgreSQL have the comment on SQL statement. MySQL has a 
comment clause for column definitions. SA could abstract away these 
differences, the syntax would be something like this:

users = Table('users', metadata,
 Column('id', Integer, primary_key=True),
 Column('name', String(40), comment=The Unix user name),
 Column('fullname', String(100), comment=Full name with title))

This way, the table definition in Python itself would be commented, and 
at the same time, comments on the database would be created that help 
you if you operate directly on the database with some admin tool.

-- Christoph

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Creating column comments on the database

2008-06-04 Thread Lukasz Szybalski

On Wed, Jun 4, 2008 at 12:09 PM, Christoph Zwerschke [EMAIL PROTECTED] wrote:

 Lukasz Szybalski schrieb:
 I started using info dict on a column names in sa file definitions. It
 would be nice to save it to db if once could.  What db supports
 comments and what table name is it?

 Oracle and PostgreSQL have the comment on SQL statement. MySQL has a
 comment clause for column definitions. SA could abstract away these
 differences, the syntax would be something like this:

 users = Table('users', metadata,
 Column('id', Integer, primary_key=True),
 Column('name', String(40), comment=The Unix user name),
 Column('fullname', String(100), comment=Full name with title))

I think I prefer info dictionary rather then a string. Dict info
which I use already have something like this:

 sqlalchemy.Column('DRIVE_TRAIN',  sqlalchemy.Unicode(4)
,info={description:DRIVE TRAIN TYPE [AWD,4WD,FWD,RWD]}),
 sqlalchemy.Column('FUEL_SYS', sqlalchemy.Unicode(4)
,info={description:FUEL SYSTEM CODE,
 FI:FUEL INJECTION,
 TB:TURBO}),

Would be nice if the whole dictionary was written to a database. I
could use info[description], info[FI], info[TB] etc... when I display
data. That would be really useful definition!!!

Lucas

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~--~~~~--~~--~--~---