blob: f4ec74d2003e09ce009dee9d852bfc913a37c3d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
.Dd January 24, 2024
.Dt SQLITE3_TOTAL_CHANGES 3
.Os
.Sh NAME
.Nm sqlite3_total_changes ,
.Nm sqlite3_total_changes64
.Nd total number of rows modified
.Sh SYNOPSIS
.In sqlite3.h
.Ft int
.Fo sqlite3_total_changes
.Fa "sqlite3*"
.Fc
.Ft sqlite3_int64
.Fo sqlite3_total_changes64
.Fa "sqlite3*"
.Fc
.Sh DESCRIPTION
These functions return the total number of rows inserted, modified
or deleted by all INSERT, UPDATE or DELETE statements
completed since the database connection was opened, including those
executed as part of trigger programs.
The two functions are identical except for the type of the return value
and that if the number of rows modified by the connection exceeds the
maximum value supported by type "int", then the return value of sqlite3_total_changes()
is undefined.
Executing any other type of SQL statement does not affect the value
returned by sqlite3_total_changes().
.Pp
Changes made as part of foreign key actions are
included in the count, but those made as part of REPLACE constraint
resolution are not.
Changes to a view that are intercepted by INSTEAD OF triggers are not
counted.
.Pp
The sqlite3_total_changes(D) interface only
reports the number of rows that changed due to SQL statement run against
database connection D.
Any changes by other database connections are ignored.
To detect changes against a database file from other database connections
use the PRAGMA data_version command or the SQLITE_FCNTL_DATA_VERSION
file control.
.Pp
If a separate thread makes changes on the same database connection
while
.Fn sqlite3_total_changes
is running then the value returned is unpredictable and not meaningful.
.Pp
.Sh IMPLEMENTATION NOTES
These declarations were extracted from the
interface documentation at line 2661.
.Bd -literal
SQLITE_API int sqlite3_total_changes(sqlite3*);
SQLITE_API sqlite3_int64 sqlite3_total_changes64(sqlite3*);
.Ed
.Sh SEE ALSO
.Xr sqlite3_changes 3 ,
.Xr sqlite3_file_control 3 ,
.Xr SQLITE_FCNTL_LOCKSTATE 3
|