Sha256: 6d4f9b3285df8865c171d04ae68b7785dbe6475c4ba78da195db3b89e304ebdd
Contents?: true
Size: 683 Bytes
Versions: 10
Compression:
Stored size: 683 Bytes
Contents
class Upsert class ColumnDefinition # @private class Mysql < ColumnDefinition class << self def all(connection, table_name) connection.execute("SHOW COLUMNS FROM #{connection.quote_ident(table_name)}").map do |row| # {"Field"=>"name", "Type"=>"varchar(255)", "Null"=>"NO", "Key"=>"PRI", "Default"=>nil, "Extra"=>""} name = row['Field'] || row['COLUMN_NAME'] type = row['Type'] || row['COLUMN_TYPE'] default = row['Default'] || row['COLUMN_DEFAULT'] new connection, name, type, default end.sort_by do |cd| cd.name end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems