defextract_limit(sql_type)casesql_typewhen/^enum\((.+)\)/i$1.split(',').map{|enum|enum.strip.length-2}.maxwhen/blob|text/icasesql_typewhen/tiny/i255when/medium/i16777215when/long/i2147483647# mysql only allows 2^31-1, not 2^32-1, somewhat inconsistently with the tiny/medium/normal caseselsesuper# we could return 65535 here, but we leave it undecorated by defaultendwhen/^bigint/i;8when/^int/i;4when/^mediumint/i;3when/^smallint/i;2when/^tinyint/i;1elsesuperendend