Change SQLite default settings

Sqlite

Sqlite Problem Overview


we know when type .mode column let me see tables like column And .headers on , we can see the header of tables. But I want to know if there is any way make the two default settings?

Do some modify for the source code of sqlite?? OR is there a config file for these settings?

Sqlite Solutions


Solution 1 - Sqlite

Put:

.headers on
.mode column

In a file called .sqliterc in the home directory of the user running sqlite.

(P.S. I found that in man sqlite3.)

Solution 2 - Sqlite

Make sure using the following command to open the file:

nano ~/.sqliterc

then add

.headers on
.mode column

to the file and save it

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaelamView Question on Stackoverflow
Solution 1 - SqliteSdaz MacSkibbonsView Answer on Stackoverflow
Solution 2 - SqliteDevB2FView Answer on Stackoverflow