From 253e67c8b3a72b3a4757fdbc5845297628db0a4a Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Sat, 25 Apr 2026 19:55:15 -0400 Subject: docs: Added All NetBSD Manuals --- static/netbsd/man3/sqlite3_exec.3 | 106 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 static/netbsd/man3/sqlite3_exec.3 (limited to 'static/netbsd/man3/sqlite3_exec.3') diff --git a/static/netbsd/man3/sqlite3_exec.3 b/static/netbsd/man3/sqlite3_exec.3 new file mode 100644 index 00000000..15930f07 --- /dev/null +++ b/static/netbsd/man3/sqlite3_exec.3 @@ -0,0 +1,106 @@ +.Dd January 24, 2024 +.Dt SQLITE3_EXEC 3 +.Os +.Sh NAME +.Nm sqlite3_exec +.Nd one-Step query execution interface +.Sh SYNOPSIS +.In sqlite3.h +.Ft int +.Fo sqlite3_exec +.Fa "sqlite3*" +.Fa "const char *sql" +.Fa "int (*callback)(void*,int,char**,char**)" +.Fa "void *" +.Fa "char **errmsg" +.Fc +.Sh DESCRIPTION +The sqlite3_exec() interface is a convenience wrapper around +.Fn sqlite3_prepare_v2 , +.Fn sqlite3_step , +and +.Fn sqlite3_finalize , +that allows an application to run multiple statements of SQL without +having to use a lot of C code. +.Pp +The sqlite3_exec() interface runs zero or more UTF-8 encoded, semicolon-separate +SQL statements passed into its 2nd argument, in the context of the +database connection passed in as its 1st argument. +If the callback function of the 3rd argument to sqlite3_exec() is not +NULL, then it is invoked for each result row coming out of the evaluated +SQL statements. +The 4th argument to sqlite3_exec() is relayed through to the 1st argument +of each callback invocation. +If the callback pointer to sqlite3_exec() is NULL, then no callback +is ever invoked and result rows are ignored. +.Pp +If an error occurs while evaluating the SQL statements passed into +sqlite3_exec(), then execution of the current statement stops and subsequent +statements are skipped. +If the 5th parameter to sqlite3_exec() is not NULL then any error message +is written into memory obtained from +.Fn sqlite3_malloc +and passed back through the 5th parameter. +To avoid memory leaks, the application should invoke +.Fn sqlite3_free +on error message strings returned through the 5th parameter of sqlite3_exec() +after the error message string is no longer needed. +If the 5th parameter to sqlite3_exec() is not NULL and no errors occur, +then sqlite3_exec() sets the pointer in its 5th parameter to NULL before +returning. +.Pp +If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() +routine returns SQLITE_ABORT without invoking the callback again and +without running any subsequent SQL statements. +.Pp +The 2nd argument to the sqlite3_exec() callback function is the number +of columns in the result. +The 3rd argument to the sqlite3_exec() callback is an array of pointers +to strings obtained as if from +.Fn sqlite3_column_text , +one for each column. +If an element of a result row is NULL then the corresponding string +pointer for the sqlite3_exec() callback is a NULL pointer. +The 4th argument to the sqlite3_exec() callback is an array of pointers +to strings where each entry represents the name of corresponding result +column as obtained from +.Fn sqlite3_column_name . +If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +to an empty string, or a pointer that contains only whitespace and/or +SQL comments, then no SQL statements are evaluated and the database +is not changed. +.Pp +Restrictions: +.Bl -bullet +.It +The application must ensure that the 1st parameter to sqlite3_exec() +is a valid and open database connection. +.It +The application must not close the database connection +specified by the 1st parameter to sqlite3_exec() while sqlite3_exec() +is running. +.It +The application must not modify the SQL statement text passed into +the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. +.El +.Pp +.Sh IMPLEMENTATION NOTES +These declarations were extracted from the +interface documentation at line 364. +.Bd -literal +SQLITE_API int sqlite3_exec( + sqlite3*, /* An open database */ + const char *sql, /* SQL to be evaluated */ + int (*callback)(void*,int,char**,char**), /* Callback function */ + void *, /* 1st argument to callback */ + char **errmsg /* Error msg written here */ +); +.Ed +.Sh SEE ALSO +.Xr sqlite3 3 , +.Xr sqlite3_column_blob 3 , +.Xr sqlite3_column_name 3 , +.Xr sqlite3_finalize 3 , +.Xr sqlite3_malloc 3 , +.Xr sqlite3_prepare 3 , +.Xr sqlite3_step 3 -- cgit v1.2.3