xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_get_autocommit.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_GET_AUTOCOMMIT 3
3.Os
4.Sh NAME
5.Nm sqlite3_get_autocommit
6.Nd test for auto-Commit mode
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3_get_autocommit
11.Fa "sqlite3*"
12.Fc
13.Sh DESCRIPTION
14The sqlite3_get_autocommit() interface returns non-zero or zero if
15the given database connection is or is not in autocommit mode, respectively.
16Autocommit mode is on by default.
17Autocommit mode is disabled by a BEGIN statement.
18Autocommit mode is re-enabled by a COMMIT or ROLLBACK.
19.Pp
20If certain kinds of errors occur on a statement within a multi-statement
21transaction (errors including SQLITE_FULL, SQLITE_IOERR,
22SQLITE_NOMEM, SQLITE_BUSY, and SQLITE_INTERRUPT)
23then the transaction might be rolled back automatically.
24The only way to find out whether SQLite automatically rolled back the
25transaction after an error is to use this function.
26.Pp
27If another thread changes the autocommit status of the database connection
28while this routine is running, then the return value is undefined.
29.Sh IMPLEMENTATION NOTES
30These declarations were extracted from the
31interface documentation at line 6554.
32.Bd -literal
33SQLITE_API int sqlite3_get_autocommit(sqlite3*);
34.Ed
35.Sh SEE ALSO
36.Xr SQLITE_OK 3
37