disabling quoting of newline in dump files (sqlite 3.19)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

disabling quoting of newline in dump files (sqlite 3.19)

Basile Starynkevitch
Hello All,

(for details and motivations about my question, see also
https://stackoverflow.com/q/44989176/841108 ...)


I'm using the latest sqlite3 3.19.3 (the package version 3.19.3-3 of
Linux/Debian/Sid/x86-64)

I want that sqlite3 .dump outputs a dump file with newline characters
appearing as is. But since 3.19 sqlite3 dump is using
replace('...\n....','\n',char(10)

The reason I want that is that the dump file is version controlled with
git and I chose sqlite3 -at that time 3.18- notably because it was able
to keep these newlines verbatim in dump files (only quoting the quote
character).


More precisely, I have a database with

|CREATETABLEt_objects (ob_id
VARCHAR(30)PRIMARYKEYASCNOTNULLUNIQUE,ob_mtim REAL NOTNULL,ob_content
TEXT NOTNULL,ob_paylkind VARCHAR(30)NOTNULL,ob_paylinit TEXT
NOTNULL,ob_paylcontent TEXT NOTNULL); and with 3.18 my dump file
contained also (with an empty line after the $c) ||INSERTINTOt_objects VALUES('_0UsE4ep7mY5_3M6VTOn9Doe',1497676631.12,'
///$c ','named','c','@NAMEDPROXY: __'); but since 3.19 the same INSERT
statement for the same row content became ||INSERTINTOt_objects
VALUES('_0UsE4ep7mY5_3M6VTOn9Doe',1497676631.1199998855,replace('\n///$c\n\n','\n',char(10)),'named','c','@NAMEDPROXY:
__'); (I added the newline before the replace for readability) FYI the
project dumping content is https://github.com/bstarynk/melt-monitor the
dump file is for example |https://github.com/bstarynk/melt-monitor/blob/master/mom_user.sql
e.g. the commit https://github.com/bstarynk/melt-monitor/blob/6bc1ada0c9ace053695d669abbb944e36993ac06/mom_user.sql

and I use git precommit and postmerge hooks to dump & restore that DB when doing git operations.

Cheers

BTW, I could probably propose a patch to fix that (probably some .lessquote metacommand) but
getting an official paper from my employer (a French goverment owned organization CEA) is much more trouble
than coding the patch itself.

Regards
--
Basile STARYNKEVITCH   == http://starynkevitch.net/Basile
opinions are mine only - les opinions sont seulement miennes
Bourg La Reine, France

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...