SQLite Forum

Query 2 databases
Login
No.  It does not and will not.

The database that is connected to by the sqlite3_open* series of API calls (or the filename argument to the sqlite3 CLI command, which merely passes the filename given to the sqlite3_open* API) has the schema identifier "main".

You do not have a choice to "like" or "not like" this fact, it simply is a fact that you cannot change.  Get used to it.

The identifier of an additional database file attached to the connection with the ATTACH command can be given any valid identifier you please as long as that identifier IS NOT "main" or "temp" as these are already in use.

```
>sqlite conn.db
SQLite version 3.34.0 2020-10-05 19:05:20
Enter ".help" for usage hints.
sqlite> attach 'att.db' as att;
sqlite> .databases
main: D:\Source\bld\conn.db r/w
att: D:\Source\bld\att.db r/w
sqlite> create table main.table1(id,field1);
sqlite> create table att.table2(id,field2);
sqlite> SELECT main.table1.field1, att.table2.field2 FROM main.table1, att.table2 WHERE main.table1.id = att.table2.id;
sqlite> .tables
att.table2  table1
sqlite>
```