[sqlalchemy] [0.7.X] - Minor omission in documentation of Dialect-specific compilation rules

2012-07-13 Thread Ladislav Lenart
Hello all.

My name is Ladislav Lenart and I am new to SQLAlchemy and this group.

I've been reading SQLAlchemy documenation at:

http://docs.sqlalchemy.org/en/rel_0_7/core/compiler.html#synopsis

I think the section Dialect-specific compilation rules contains an error:
 * Both decorated compile functions use the same name 'visit_alter_column'.
 * The sentence immediately below the example talks about 'visit_alter_table'.

I think the 2nd (postgresql specific) compile function should be called
'visit_alter_table'. Am I right or not?


HTH,

Ladislav Lenart

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] fractional second percision- mysql

2012-07-13 Thread James


 Yeah, I kind of suspected MySQLdb might have problems here.  You need to 
 file a bug report with the DBAPI's bug tracker:
 http://sourceforge.net/tracker/?group_id=22307atid=374932


I didn't see anything on the subject of fractional second support but I 
ended up getting the insert working by the format_TIME function in 
/MySQLdb/times.py to process microseconds:

def format_TIMEDELTA(v):

microseconds = v.microseconds
seconds = float(v.seconds) % 60
minutes = int(v.seconds / 60) % 60
hours = int(v.seconds / 3600) % 24

return '%d %d:%d:%d.%d' % (v.days, hours, minutes, seconds, 
microseconds)

Thank you for your help with the SQLalchemy side of things, redefining how 
the DDL is emitted for the type and whatnot. Hopefully we can see these 
changes in future releases of the 0.7 series.

--James

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/9u5Yiq9v6LMJ.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] fractional second percision- mysql

2012-07-13 Thread Michael Bayer

On Jul 13, 2012, at 6:36 PM, James wrote:

 Yeah, I kind of suspected MySQLdb might have problems here.  You need to file 
 a bug report with the DBAPI's bug tracker:
 http://sourceforge.net/tracker/?group_id=22307atid=374932
 
 I didn't see anything on the subject of fractional second support but I ended 
 up getting the insert working by the format_TIME function in 
 /MySQLdb/times.py to process microseconds:
 
 def format_TIMEDELTA(v):
 
 microseconds = v.microseconds
 seconds = float(v.seconds) % 60
 minutes = int(v.seconds / 60) % 60
 hours = int(v.seconds / 3600) % 24
 
 return '%d %d:%d:%d.%d' % (v.days, hours, minutes, seconds, microseconds)
 
 Thank you for your help with the SQLalchemy side of things, redefining how 
 the DDL is emitted for the type and whatnot. Hopefully we can see these 
 changes in future releases of the 0.7 series.

are you saying you patched mysqldb/times.py directly?   yeah, MySQLdb would 
need to implement this change properly for the SQLAlchemy side of things to be 
of any use.  We can't just tell our users to patch their MySQLdb clients. 
harmless enough for us to look for the microseconds portion on our end, 
anyway.

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.