Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
KSQL_CLOSE(3)	       FreeBSD Library Functions Manual		 KSQL_CLOSE(3)

NAME
     ksql_close	-- close a ksql	database connection

LIBRARY
     library "ksql"

SYNOPSIS
     #include <sys/types.h>
     #include <stdint.h>
     #include <ksql.h>

     enum ksqlc
     ksql_close(struct ksql *sql);

DESCRIPTION
     The ksql_close function closes a database connection opened with
     ksql_open(3).  If the connection was not opened, is already closed, or
     sql is NULL, this function	is a no-op.

     This function will	begin by calling sqlite3_finalize(3) on	all active
     statements	(it is an error	to have	any open connections), then it will
     roll back any open	transactions (also triggering an error)	if found, then
     it	will close out the database itself with	sqlite3_close(3).  In the
     event of statements still being open, all statements are finalised	and
     the database closed prior to calling the error handler.  If
     KSQL_FAIL_ON_EXIT was specified on	sql, the exit(2) will only be invoked
     after all resources have been closed and freed.

RETURN VALUES
     This returns KSQL_STMT if there were open statements, KSQL_TRANS if there
     was an open transaction (if there were both open statements and a trans-
     action, this is returned),	KSQL_DB	if there were database-level errors
     (this overrides whether there were	open transactions and/or a transac-
     tion), or KSQL_OK on success.

SEE ALSO
     sqlite3_close(3), sqlite3_exec(3),	sqlite3_finalize(3)

FreeBSD	13.0			 April 3, 2018			  FreeBSD 13.0

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ksql_close&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help