#1 2013-12-30 15:41:26

Eric
Member
Registered: 2012-11-26
Posts: 129
Website

SQLite open_v2

Currently TSQLDataBase.DBOpen uses sqlite3.open, it could be nice to use open_v2 instead and the extra flags it supports.

Basically 'open' should be replaced by 'open_v2', an extra parameter with the flags added (default value SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE), and the following constants added:

  SQLITE_OPEN_READONLY       = $00000001;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_READWRITE      = $00000002;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_CREATE         = $00000004;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_DELETEONCLOSE  = $00000008;  // VFS only
  SQLITE_OPEN_EXCLUSIVE      = $00000010;  // VFS only
  SQLITE_OPEN_AUTOPROXY      = $00000020;  // VFS only
  SQLITE_OPEN_URI            = $00000040;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_MEMORY         = $00000080;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_MAIN_DB        = $00000100;  // VFS only
  SQLITE_OPEN_TEMP_DB        = $00000200;  // VFS only
  SQLITE_OPEN_TRANSIENT_DB   = $00000400;  // VFS only
  SQLITE_OPEN_MAIN_JOURNAL   = $00000800;  // VFS only
  SQLITE_OPEN_TEMP_JOURNAL   = $00001000;  // VFS only
  SQLITE_OPEN_SUBJOURNAL     = $00002000;  // VFS only
  SQLITE_OPEN_MASTER_JOURNAL = $00004000;  // VFS only
  SQLITE_OPEN_NOMUTEX        = $00008000;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_FULLMUTEX      = $00010000;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_SHAREDCACHE    = $00020000;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_PRIVATECACHE   = $00040000;  // Ok for sqlite3_open_v2()
  SQLITE_OPEN_WAL            = $00080000;  // VFS only

Offline

#2 2013-12-31 15:09:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: SQLite open_v2

We have added sqlite3.open_v2() support and optional flags for TSQLDataBase.Create() plus associated read-only TSQLDataBase.OpenV2Flags property.
See http://synopse.info/fossil/info/82b917a0ca

Offline

#3 2014-01-06 09:54:11

Eric
Member
Registered: 2012-11-26
Posts: 129
Website

Re: SQLite open_v2

Great, thanks!

Offline

Board footer

Powered by FluxBB