SQLite DETACH DATABASE explanation is utilized to disconnect and separate a named information base from a data set association which was recently connected utilizing ATTACH proclamation. In the event that a similar data set document has been appended with numerous false names, at that point DETACH order will disengage just the given name and rest of the connection will in any case proceed. You can't withdraw the principle or temp data sets.
In the event that the information base is an in-memory or brief data set, the data set will be decimated and the substance will be lost.
Syntax
Following is the essential language structure of SQLite DETACH DATABASE 'Nom de plume Name' proclamation.
DETACH DATABASE 'Alias-Name';
Here, 'Moniker Name' is a similar false name, which you had utilized while appending the data set utilizing ATTACH articulation.
Example
Consider you have a data set, which you made in the past section and connected it with 'test' and 'currentDB' as we can see utilizing .data set order.
sqlite>.databases
seq name file
--- --------------- ----------------------
0 main /home/sqlite/testDB.db
2 test /home/sqlite/testDB.db
3 currentDB /home/sqlite/testDB.db
How about we attempt to segregate 'currentDB' from testDB.db utilizing the accompanying order.
sqlite> DETACH DATABASE 'currentDB';
Presently, on the off chance that you will check the current connection, you will find that testDB.db is as yet associated with 'test' and 'fundamental'.
sqlite>.databases
seq name file
--- --------------- ----------------------
0 main /home/sqlite/testDB.db
2 test /home/sqlite/testDB.db