dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.09k stars 67 forks source link

`ATTACH DATABASE` not supported #124

Closed WesleyAC closed 2 years ago

WesleyAC commented 2 years ago

If I run litecli with no arguments, and then run ATTACH DATABASE 'db.sqlite3' AS db; I get the result Not connected to database., and cannot query the database. This is in contrast to the sqlite3 CLI, which does support this.

Could support for this be added?

amjith commented 2 years ago

I will look into this. In the meantime you can use .open filename.db to open a database after you've launched litecli.

amjith commented 2 years ago

Looks like an active connection is required in order to run the ATTACH DATABASE command. I don't see a way to work around this requirement. For now you can use .open to attach the first database and then run the ATTACH statement as usual.