Congrats for this very useful extension. I would like to mention some issues in the CSV export when having text in a table:
1-The export is not working in case of text with special characters, see description below
2- A new line is generated in case of a text embedding a newline character in it
3- There are additional blank lines generated in CSV (on windows)
To Reproduce Issue 1
open a Sqlite database in the editor, select a table with a text column with some of those texts having extended ASCII codes
Click on 'other Tools' > Export Table to CSV
See error in the terminal:
Traceback (most recent call last):
File "c:\Users....vscode\extensions\yy0931.vscode-sqlite3-editor-1.0.85\export_table.py", line 26, in
writer.writerow(row)
File "C:\Users...\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
Solution tested
I have modified "export_table.py" by adding some arguments to the open, and it does solve the 3 issues for me:
with contextlib.closing(sqlite3.connect(args.database)) as conn, open(args.out_file, "w") as f:
with contextlib.closing(sqlite3.connect(args.database)) as conn, open(args.out_file, "w",newline='', encoding='utf-8') as f:
Congrats for this very useful extension. I would like to mention some issues in the CSV export when having text in a table:
1-The export is not working in case of text with special characters, see description below 2- A new line is generated in case of a text embedding a newline character in it 3- There are additional blank lines generated in CSV (on windows)
To Reproduce Issue 1
Solution tested I have modified "export_table.py" by adding some arguments to the open, and it does solve the 3 issues for me:
with contextlib.closing(sqlite3.connect(args.database)) as conn, open(args.out_file, "w") as f:
with contextlib.closing(sqlite3.connect(args.database)) as conn, open(args.out_file, "w",newline='', encoding='utf-8') as f: