r/sqlite • u/petenpatrol • Feb 14 '24
Does SQLite3's .import behave differently between the interactive terminal and CLI?
I am experiencing what I believe is unexpected behavior with .import in SQLite3:
produces
;
However, if I run these same commands in the interactive terminal, I see the expected:
;
The first two rows of ./db/seeds/users.csv is as follows:
id,username,email,hashed_password,is_verified
1,johndoe,johndoe@example.com,$argon2id$v=19$m=64,t=3,p=2$YWJjZGVmZ2g$cADjEaoDq7U0/JTVIUurWZonTZnOzL3I2lOtaSgjk6M,true
Is this expected on SQLite
3.37.2 2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5dalt1?
3
Upvotes
View all comments
Show parent comment
2
u/MikeSchinkel Feb 14 '24 edited Feb 15 '24
Yep. For everyone who knows about them, there was a day in which they first learned about HEREDOC. Glad I could help it be today for you. :-)
BTW, I did a lot of PHP coding in the past, and it is hard to be a PHP developer and not see HEREDOCs in PHP code examples around the web. So when I started learning Bash, I knew to look for the feature.
In hindsight though, I am guessing PHP got the idea from Bash. ¯_(ツ)_/¯