Skip to content

Instantly share code, notes, and snippets.

@outoftime
Created October 24, 2013 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save outoftime/7145781 to your computer and use it in GitHub Desktop.
Save outoftime/7145781 to your computer and use it in GitHub Desktop.
connection = Cequel.connect(...)
table = connection.schema.read_table(:assessors)
my_data.each do |row|
typecast_row = {}
row.each_pair do |column_name, value|
typecast_row[column_name] = table.column(column_name).cast(value)
end
connection[:assessors].insert(typecast_row)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment