From ec9bd35d2182fb2e3c66f736073d9eaa30c78b39 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Tue, 2 Jul 2024 11:55:49 +0200 Subject: [PATCH] Add a hint to use type maps to Connection#copy_data Closes #571 --- lib/pg/connection.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pg/connection.rb b/lib/pg/connection.rb index 611339109..7043ba9d4 100644 --- a/lib/pg/connection.rb +++ b/lib/pg/connection.rb @@ -166,7 +166,10 @@ def inspect # conn.put_copy_data ['more', 'data', 'to', 'copy'] # end # - # Also PG::BinaryEncoder::CopyRow can be used to send data in binary format to the server. + # All 4 CopyRow classes can take a type map to specify how the columns are mapped to and from the database format. + # For details see the particular CopyRow class description. + # + # PG::BinaryEncoder::CopyRow can be used to send data in binary format to the server. # In this case copy_data generates the header and trailer data automatically: # enco = PG::BinaryEncoder::CopyRow.new # conn.copy_data "COPY my_table FROM STDIN (FORMAT binary)", enco do