/ Check-in [5e944eea]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the documentation text for the new VFS interfaces used by batch-atomic writes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | batch-atomic-write
Files: files | file ages | folders
SHA3-256: 5e944eea5a32cb4d27a2d5ae283b9ce6fe08c1bc584256e8e8c78583c415eb2a
User & Date: drh 2017-07-20 21:18:49
Context
2017-07-21
14:49
Additional documentation on the new VFS interface. No changes to code. check-in: 83077ec8 user: drh tags: batch-atomic-write
2017-07-20
21:18
Add the documentation text for the new VFS interfaces used by batch-atomic writes. check-in: 5e944eea user: drh tags: batch-atomic-write
21:01
Transform two #ifdef statements into #if statements. check-in: f2c6b584 user: drh tags: batch-atomic-write
2017-07-19
11:20
Add VFS interfaces needed to make use of batch atomic write capabilities in the underlying filesystem. check-in: 929bc46b user: drh tags: batch-atomic-write
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqlite.h.in.

   576    576   ** file that were written at the application level might have changed
   577    577   ** and that adjacent bytes, even bytes within the same sector are
   578    578   ** guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
   579    579   ** flag indicates that a file cannot be deleted when open.  The
   580    580   ** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
   581    581   ** read-only media and cannot be changed even by processes with
   582    582   ** elevated privileges.
          583  +**
          584  +** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
          585  +** filesystem can multiple write operations atomically when those
          586  +** write operations are bracketed by [SQLITE_IOCAP_BEGIN_ATOMIC_WRITE] and
          587  +** [SQLITE_IOCAP_ATOMIC_WRITE_COMMIT].
   583    588   */
   584    589   #define SQLITE_IOCAP_ATOMIC                 0x00000001
   585    590   #define SQLITE_IOCAP_ATOMIC512              0x00000002
   586    591   #define SQLITE_IOCAP_ATOMIC1K               0x00000004
   587    592   #define SQLITE_IOCAP_ATOMIC2K               0x00000008
   588    593   #define SQLITE_IOCAP_ATOMIC4K               0x00000010
   589    594   #define SQLITE_IOCAP_ATOMIC8K               0x00000020
................................................................................
  1010   1015   ** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other
  1011   1016   ** VFS should return SQLITE_NOTFOUND for this opcode.
  1012   1017   **
  1013   1018   ** <li>[[SQLITE_FCNTL_RBU]]
  1014   1019   ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by
  1015   1020   ** the RBU extension only.  All other VFS should return SQLITE_NOTFOUND for
  1016   1021   ** this opcode.  
         1022  +**
         1023  +** <li>[[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]]
         1024  +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, that
         1025  +** means all subsequent write operations will be deferred and done
         1026  +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].  Systems
         1027  +** that do not support batch atomic writes will return SQLITE_NOTFOUND.
         1028  +**
         1029  +** <li>[[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]]
         1030  +** If the [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write
         1031  +** operations since the previous successful call to 
         1032  +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically.
         1033  +** This file control returns [SQLITE_OK] if and only if the writes were
         1034  +** all performed successfully and have been committed to persistent storage.
         1035  +**
         1036  +** <li>[[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]]
         1037  +** If the [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write
         1038  +** operations since the previous successful call to 
         1039  +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rollback.
  1017   1040   ** </ul>
  1018   1041   */
  1019   1042   #define SQLITE_FCNTL_LOCKSTATE               1
  1020   1043   #define SQLITE_FCNTL_GET_LOCKPROXYFILE       2
  1021   1044   #define SQLITE_FCNTL_SET_LOCKPROXYFILE       3
  1022   1045   #define SQLITE_FCNTL_LAST_ERRNO              4
  1023   1046   #define SQLITE_FCNTL_SIZE_HINT               5
................................................................................
  1041   1064   #define SQLITE_FCNTL_WAL_BLOCK              24
  1042   1065   #define SQLITE_FCNTL_ZIPVFS                 25
  1043   1066   #define SQLITE_FCNTL_RBU                    26
  1044   1067   #define SQLITE_FCNTL_VFS_POINTER            27
  1045   1068   #define SQLITE_FCNTL_JOURNAL_POINTER        28
  1046   1069   #define SQLITE_FCNTL_WIN32_GET_HANDLE       29
  1047   1070   #define SQLITE_FCNTL_PDB                    30
  1048         -
  1049   1071   #define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE     31
  1050   1072   #define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE    32
  1051   1073   #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE  33
  1052   1074   
  1053   1075   /* deprecated names */
  1054   1076   #define SQLITE_GET_LOCKPROXYFILE      SQLITE_FCNTL_GET_LOCKPROXYFILE
  1055   1077   #define SQLITE_SET_LOCKPROXYFILE      SQLITE_FCNTL_SET_LOCKPROXYFILE