This repository was archived by the owner on Mar 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,29 @@ Use the following vscode settings by either:
8181
8282### Testing
8383
84+ ### Postgres debugging
85+
86+ Ensure the database you are using is in utf8 mode. You cannot change encoding once the database is created.
87+
88+ ``` sql
89+
90+ CREATE DATABASE "my_database "
91+ WITH OWNER " postgres"
92+ ENCODING ' UTF8'
93+ TEMPLATE template0;
94+
95+ ```
96+
97+ Also ensure that the database has the CITEXT extension by logging into the DB and adding it
98+
99+ ``` sql
100+
101+ >>> psql my_database
102+
103+ CREATE EXTENSION CITEXT;
104+
105+ ```
106+
84107#### Integration
85108
86109The test batch files assume there is a user by the name of ` postgres ` on the system.
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def write_data_frame_to_table(self, data_frame):
5858 raw = self .target_db .raw_connection ()
5959 curs = raw .cursor ()
6060
61+ # log CSV on debug
62+ if self .logger .getEffectiveLevel () == logging .DEBUG :
63+ with open (f'{ qualified_target_table } .csv' , 'w' , encoding = 'utf-8' ) as f :
64+ f .write (data .getvalue ())
65+
6166 column_array = list (
6267 map (lambda source_colum_name : self .get_destination_column_name (source_colum_name ), data_frame .columns ))
6368 column_list = ',' .join (map (str , column_array ))
You can’t perform that action at this time.
0 commit comments