[sqlalchemy] Re: use_labels =30 vs MAX_LABEL_LENGTH

2007-03-17 Thread jose

Michael Bayer wrote:

ideally the truncation should be occuring at the SQL compilation  
phase so you wouldnt have this problem.  i recall that being very  
complex but i should take a look again to see if theres any major  
barriers to that.

but for now, sure, ive no problem with a module-level global.  just  
be aware that if i fix this in a better way it might be removed in a  
later release.
  

actually, we have this restriction because Oracle and Firebird use short 
names.
May be you may assign the MAXLENGTH depending on the database, for example:

* MySQL = 64
* PostgreSQL = 64 - 1
* Firebird = 31 ?
* Oracle = 30
* MS-SQL = 128
* SQLite = no limites (The name and CREATE TABLE statement for a table 
must fit entirely within a 1-megabyte row of the SQLITE_MASTER table. 
Other than this, there are no constraints on the length of the name of a 
table, or on the number of columns, etc. Indices are similarly 
unconstrained).

On Mar 16, 2007, at 4:05 PM, Jose Soares wrote:

  

Hi Michael,

I see that sql.py uses a limit of 30 characters to create the column
label when use_labels is set to True.
If name is greater than 30 char long, the label is trunked at position
24 and is appended a random integer to it.
Since the name created in this way is less useful, I would like to
sugest you to customize the maxlength of column names.
(PostgreSQL accepts until 63 characters for names, with SQLite you may
use very, very long names)





--~--~-~--~~~---~--~~
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: use_labels =30 vs MAX_LABEL_LENGTH

2007-03-17 Thread Jorge Godoy

jose [EMAIL PROTECTED] writes:

 * PostgreSQL = 64 - 1

This can be changed in compilation time.

-- 
Jorge Godoy  [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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: use_labels =30 vs MAX_LABEL_LENGTH

2007-03-17 Thread Michael Bayer


On Mar 17, 3:57 am, jose [EMAIL PROTECTED] wrote:
 May be you may assign the MAXLENGTH depending on the database, for example:

 * MySQL = 64
 * PostgreSQL = 64 - 1
 * Firebird = 31 ?
 * Oracle = 30
 * MS-SQL = 128

well yes thats the whole issue.  we are doing the length truncation at
the point at which you create a SQL construct.

s = select([foo.label(im_a_long_label])

no dialect/database has entered the equation at that point.


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