Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change SQLite default settings

Tags:

sqlite

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?

like image 289
aelam Avatar asked Mar 09 '11 02:03

aelam


People also ask

What is default mode in SQLite?

In this mode (which is the default when SQLite is compiled with SQLITE_THREADSAFE=1) the SQLite library will itself serialize access to database connections and prepared statements so that the application is free to use the same database connection or the same prepared statement in different threads at the same time.

What is SQLite page size?

SQLite supports page size range from 512 to 65536 bytes.

How do I rename a column in SQLite?

It is not possible to rename a column, remove a column, or add or remove constraints from a table. The sqlite file format is very simple and that's why this operation is valid.

How do I drop a column in SQLite?

DB Browser for SQLite allows you to add or drop columns. In the main view, tab Database Structure , click on the table name. A button Modify Table gets enabled, which opens a new window where you can select the column/field and remove it.


2 Answers

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.)

like image 86
Sdaz MacSkibbons Avatar answered Oct 02 '22 18:10

Sdaz MacSkibbons


Make sure using the following command to open the file:

nano ~/.sqliterc 

then add

.headers on .mode column 

to the file and save it

like image 29
DevB2F Avatar answered Oct 02 '22 17:10

DevB2F