With SQlite, how do you show the current PRAGMA settings?

With SQlite, how do you show the current PRAGMA settings?

And when they are configured, are they permanent or should they be installed with each request?

Chris

+5
source share
1 answer

In the simplest form, the current pragma settings can be obtained simply by executing the sql statement with the syntax PRAGMA <command>. For example, when debugging PHP using PDO, you can do something like this:

$db = new PDO("sqlite: myDb.sqlite");
$synchronous = $db->query("PRAGMA synchronous")->fetchColumn();

To set values, use PRAGMA <command> = <value>. However, there will be no return value (so don’t worry that fetchthere is anything).

$db->query("PRAGMA synchronous = OFF");

, , turlando, , , PRAGMA . sqlite. , , , .

+4

All Articles