postgres-copy
postgres-copy copied to clipboard
Simple PostgreSQL's COPY command support in ActiveRecord models
When copying from CSV to DB, would there be any way of skipping a column if it doesn't map to any table row in the DB?
Is there a way I could set encoding like this - `:encoding => 'windows-1251'` I am getting "invalid byte sequence in UTF-8" error
I'm using postgres-copy for importing CSV files in tempory tables that are later used for parsing line by line(record by record). That's why such ActiveRecord models & tables could not...
First of all, @diogob thanks for this fantastic and very helpful gem! I have an idea on how this could be for new users because there is a minor issue...
I'm seeing an issue where column names are: A) converted to lowercase (they are uppercase in the SQL) B) cannot be remapped in ruby code (without hacking around in the...
Command: User.select("**Other_column**").where(:id => [1,2,3]).copy_to "/tmp/users.csv" Is generating the following SQL command: COPY (SELECT **name** FROM "users" WHERE "users"."id" IN (1, 2, 3)) TO '/tmp/users.csv' WITH DELIMITER ',' CSV HEADER ※Mentioed...
When I tried to use this gem on Jruby 1.7.10 I got the following error, basically it looks like this gem has a hard requirement on the MRI / cruby...
This PR aims to add an encoding option for `copy_to` methods. If none is specified, it defaults to _UTF8_.