I'm importing a csv to a table in the database in the following way. In terminal:
Terminal>sqlite3 test.db
sqlite3>.import /Users/Downloads/test.csv trial1
sqlite3> attach database 'test.db' as 'alias_test';
sqlite3> .database
seq name file
--- --------------- ----------------------------------------------------------
0 main /Users/Downloads/testattach.db
2 test_alias /Users/Downloads/testattach.db
But when I restart the terminal and type:
>sqlite3 test.db '.database'
I get:
seq name file
--- --------------- ----------------------------------------------------------
0 main /Users/Downloads/testattach.db
I want to understand why the attached database name is not shown when I access the database again.
1 Answer 1
The documentation says:
The ATTACH DATABASE statement adds another database file to the current database connection.
Restarting creates a new connection.
answered Jul 8, 2016 at 7:32
CL.
182k18 gold badges241 silver badges282 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-sql