I’m currently using the following command in bash to list the info from an sqlite3 database
sqlite3 -header /path/to/database.db "select * from TABLEHERE";
However the issue is that if the database is empty it comes back as null and doesn’t list the headers. How can i list the headers of an empty table in bash? I also need it in one command as it will be run in Java.
Don’t know anything about the plain header, but you can get the tableinfo by using the
table_infopragma.