Recent

Author Topic: SQLite and PRAGMAs  (Read 1492 times)

Человек_Борща

  • New Member
  • *
  • Posts: 33
    • My little IT world.
SQLite and PRAGMAs
« on: June 18, 2015, 10:53:20 pm »
Greetings!

When I must setup PRAGMAs? At each loading the database?
{
Open connection
Direct execute PRAGMAs?
}

or when I'm creating a new database?

How I can query PRAGMAs values?
For example: FREELIST_COUNT.
« Last Edit: June 18, 2015, 10:56:36 pm by Человек_Борща »
With best regards, Alexandr.
_
OS: Windows 8.1 x64 / Ubuntu 14.02 x64
IDE: CodeTyphon 5.4 (win32-win64/win64) / FPC 3.1.1

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: SQLite and PRAGMAs
« Reply #1 on: June 18, 2015, 11:06:10 pm »
Greetings!

When I must setup PRAGMAs? At each loading the database?
{
Open connection
Direct execute PRAGMAs?
}

or when I'm creating a new database?

How I can query PRAGMAs values?
For example: FREELIST_COUNT.
depends on the pragma you want to run but if I"m not mistaken most pragma are connection bound which means that you need to call them after each connection opens for all connection if you use multiple connections in your application. For better info just reference the pragma you are interested in.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018