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

FreeBSD Manual Pages

  
 
  

home | help
KSQL_OPEN(3)		 BSD Library Functions Manual		  KSQL_OPEN(3)

NAME
     ksql_open -- open a ksql database connection

LIBRARY
     library "ksql"

SYNOPSIS
     #include <ksql.h>

     enum ksqlc
     ksql_open(struct ksql *sql, const char *dbfile);

DESCRIPTION
     The ksql_open function opens a database connection	to dbfile (which must
     exists) on	a handle allocated with	ksql_alloc(3).	If sql already has a
     database connection open, it will close it	first with ksql_close(3).  If
     the handle	was allocated with KSQL_FOREIGN_KEYS, a	successful open	will
     be	followed by a ksql_exec(3) call	to enable foreign keys.

     The ksql_open function handles a locked database (specifically,
     SQLITE_BUSY, SQLITE_LOCKED, or SQLITE_PROTOCOL) by	sleeping for a random
     interval, then trying again infinitely.

RETURN VALUES
     This returns the exit code	of ksql_close(3) if it failed, the exit	code
     of	ksql_exec if it	failed to enable foreign keys, KSQL_MEM	if memory al-
     location failed, KSQL_DB if the sqlite3_open(3) function failed, other-
     wise KSQL_OK on success.

SEE ALSO
     sqlite3_exec(3), sqlite3_open(3)

BSD				 April 5, 2016				   BSD

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_open&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help