How to name a SQLite database so that it does not have a default name?

How can I name a SQLite database so that it does not have a default name of main ?

+6
source share
2 answers

You can not. "main" is simply the name that SQLite always uses for the primary database that you opened. (If necessary, you can add additional databases using ATTACH .)

http://www.sqlite.org/lang_attach.html

+6
source

I do not think so.

The main database has special meaning.
You can attach other databases with different names.

From http://www.sqlite.org/sqlite.html

The ".databases" command shows a list of all the databases open in the current connection. There will always be at least 2. The first is the "main", the original database is open. The second is "temp", the database used for temporary tables. There may be additional databases listed for databases attached using the ATTACH statement. The first output column is the name that the database is bound to, and the second column is the file name of the external file.

+8
source

Source: https://habr.com/ru/post/896671/


All Articles