| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 |
<link href="../sqlite.css" rel="stylesheet"> |
| 6 |
<title>Database Connection Handle</title> |
| 7 |
<!-- path=../ --> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<div class=nosearch> |
| 11 |
<a href="../index.html"> |
| 12 |
<img class="logo" src="../images/sqlite370_banner.svg" alt="SQLite" border="0"> |
| 13 |
</a> |
| 14 |
<div><!-- IE hack to prevent disappearing logo --></div> |
| 15 |
<div class="tagline desktoponly"> |
| 16 |
Small. Fast. Reliable.<br>Choose any three. |
| 17 |
</div> |
| 18 |
<div class="menu mainmenu"> |
| 19 |
<ul> |
| 20 |
<li><a href="../index.html">Home</a> |
| 21 |
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a> |
| 22 |
<li class='wideonly'><a href='../about.html'>About</a> |
| 23 |
<li class='desktoponly'><a href="../docs.html">Documentation</a> |
| 24 |
<li class='desktoponly'><a href="../download.html">Download</a> |
| 25 |
<li class='wideonly'><a href='../copyright.html'>License</a> |
| 26 |
<li class='desktoponly'><a href="../support.html">Support</a> |
| 27 |
<li class='desktoponly'><a href="../prosupport.html">Purchase</a> |
| 28 |
<li class='search' id='search_menubutton'> |
| 29 |
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a> |
| 30 |
</ul> |
| 31 |
</div> |
| 32 |
<div class="menu submenu" id="submenu"> |
| 33 |
<ul> |
| 34 |
<li><a href='../about.html'>About</a> |
| 35 |
<li><a href='../docs.html'>Documentation</a> |
| 36 |
<li><a href='../download.html'>Download</a> |
| 37 |
<li><a href='../support.html'>Support</a> |
| 38 |
<li><a href='../prosupport.html'>Purchase</a> |
| 39 |
</ul> |
| 40 |
</div> |
| 41 |
<div class="searchmenu" id="searchmenu"> |
| 42 |
<form method="GET" action="../search"> |
| 43 |
<select name="s" id="searchtype"> |
| 44 |
<option value="d">Search Documentation</option> |
| 45 |
<option value="c">Search Changelog</option> |
| 46 |
</select> |
| 47 |
<input type="text" name="q" id="searchbox" value=""> |
| 48 |
<input type="submit" value="Go"> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<script> |
| 53 |
function toggle_div(nm) { |
| 54 |
var w = document.getElementById(nm); |
| 55 |
if( w.style.display=="block" ){ |
| 56 |
w.style.display = "none"; |
| 57 |
}else{ |
| 58 |
w.style.display = "block"; |
| 59 |
} |
| 60 |
} |
| 61 |
function toggle_search() { |
| 62 |
var w = document.getElementById("searchmenu"); |
| 63 |
if( w.style.display=="block" ){ |
| 64 |
w.style.display = "none"; |
| 65 |
} else { |
| 66 |
w.style.display = "block"; |
| 67 |
setTimeout(function(){ |
| 68 |
document.getElementById("searchbox").focus() |
| 69 |
}, 30); |
| 70 |
} |
| 71 |
} |
| 72 |
function div_off(nm){document.getElementById(nm).style.display="none";} |
| 73 |
window.onbeforeunload = function(e){div_off("submenu");} |
| 74 |
/* Disable the Search feature if we are not operating from CGI, since */ |
| 75 |
/* Search is accomplished using CGI and will not work without it. */ |
| 76 |
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){ |
| 77 |
document.getElementById("search_menubutton").style.display = "none"; |
| 78 |
} |
| 79 |
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */ |
| 80 |
function hideorshow(btn,obj){ |
| 81 |
var x = document.getElementById(obj); |
| 82 |
var b = document.getElementById(btn); |
| 83 |
if( x.style.display!='none' ){ |
| 84 |
x.style.display = 'none'; |
| 85 |
b.innerHTML='show'; |
| 86 |
}else{ |
| 87 |
x.style.display = ''; |
| 88 |
b.innerHTML='hide'; |
| 89 |
} |
| 90 |
return false; |
| 91 |
} |
| 92 |
var antiRobot = 0; |
| 93 |
function antiRobotGo(){ |
| 94 |
if( antiRobot!=3 ) return; |
| 95 |
antiRobot = 7; |
| 96 |
var j = document.getElementById("mtimelink"); |
| 97 |
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 98 |
} |
| 99 |
function antiRobotDefense(){ |
| 100 |
document.body.onmousedown=function(){ |
| 101 |
antiRobot |= 2; |
| 102 |
antiRobotGo(); |
| 103 |
document.body.onmousedown=null; |
| 104 |
} |
| 105 |
document.body.onmousemove=function(){ |
| 106 |
antiRobot |= 2; |
| 107 |
antiRobotGo(); |
| 108 |
document.body.onmousemove=null; |
| 109 |
} |
| 110 |
setTimeout(function(){ |
| 111 |
antiRobot |= 1; |
| 112 |
antiRobotGo(); |
| 113 |
}, 100) |
| 114 |
antiRobotGo(); |
| 115 |
} |
| 116 |
antiRobotDefense(); |
| 117 |
</script> |
| 118 |
<!-- keywords: {database connection} {database connections} sqlite3 --> |
| 119 |
<div class=nosearch> |
| 120 |
<a href="../c3ref/intro.html"><h2>SQLite C Interface</h2></a> |
| 121 |
<h2>Database Connection Handle</h2> |
| 122 |
</div> |
| 123 |
<blockquote><pre> |
| 124 |
typedef struct sqlite3 sqlite3; |
| 125 |
</pre></blockquote> |
| 126 |
<p> |
| 127 |
Each open SQLite database is represented by a pointer to an instance of |
| 128 |
the opaque structure named "sqlite3". It is useful to think of an sqlite3 |
| 129 |
pointer as an object. The <a href="../c3ref/open.html">sqlite3_open()</a>, <a href="../c3ref/open.html">sqlite3_open16()</a>, and |
| 130 |
<a href="../c3ref/open.html">sqlite3_open_v2()</a> interfaces are its constructors, and <a href="../c3ref/close.html">sqlite3_close()</a> |
| 131 |
and <a href="../c3ref/close.html">sqlite3_close_v2()</a> are its destructors. There are many other |
| 132 |
interfaces (such as |
| 133 |
<a href="../c3ref/prepare.html">sqlite3_prepare_v2()</a>, <a href="../c3ref/create_function.html">sqlite3_create_function()</a>, and |
| 134 |
<a href="../c3ref/busy_timeout.html">sqlite3_busy_timeout()</a> to name but three) that are methods on an |
| 135 |
sqlite3 object. |
| 136 |
</p><p>3 Constructors using this object: |
| 137 |
<a href="../c3ref/open.html">sqlite3_open()</a>, |
| 138 |
<a href="../c3ref/open.html">sqlite3_open16()</a>, |
| 139 |
<a href="../c3ref/open.html">sqlite3_open_v2()</a></p> |
| 140 |
<p>2 Destructors using this object: |
| 141 |
<a href="../c3ref/close.html">sqlite3_close()</a>, |
| 142 |
<a href="../c3ref/close.html">sqlite3_close_v2()</a></p> |
| 143 |
<p>80 Methods using this object: |
| 144 |
<div class='columns' style='columns: 17em auto;'> |
| 145 |
<ul style='padding-top:0;'> |
| 146 |
<li><a href='../c3ref/autovacuum_pages.html'>sqlite3_autovacuum_pages</a></li> |
| 147 |
<li><a href='../c3ref/blob_open.html'>sqlite3_blob_open</a></li> |
| 148 |
<li><a href='../c3ref/busy_handler.html'>sqlite3_busy_handler</a></li> |
| 149 |
<li><a href='../c3ref/busy_timeout.html'>sqlite3_busy_timeout</a></li> |
| 150 |
<li><a href='../c3ref/changes.html'>sqlite3_changes</a></li> |
| 151 |
<li><a href='../c3ref/changes.html'>sqlite3_changes64</a></li> |
| 152 |
<li><a href='../c3ref/collation_needed.html'>sqlite3_collation_needed</a></li> |
| 153 |
<li><a href='../c3ref/collation_needed.html'>sqlite3_collation_needed16</a></li> |
| 154 |
<li><a href='../c3ref/commit_hook.html'>sqlite3_commit_hook</a></li> |
| 155 |
<li><a href='../c3ref/create_collation.html'>sqlite3_create_collation</a></li> |
| 156 |
<li><a href='../c3ref/create_collation.html'>sqlite3_create_collation16</a></li> |
| 157 |
<li><a href='../c3ref/create_collation.html'>sqlite3_create_collation_v2</a></li> |
| 158 |
<li><a href='../c3ref/create_function.html'>sqlite3_create_function</a></li> |
| 159 |
<li><a href='../c3ref/create_function.html'>sqlite3_create_function16</a></li> |
| 160 |
<li><a href='../c3ref/create_function.html'>sqlite3_create_function_v2</a></li> |
| 161 |
<li><a href='../c3ref/create_module.html'>sqlite3_create_module</a></li> |
| 162 |
<li><a href='../c3ref/create_module.html'>sqlite3_create_module_v2</a></li> |
| 163 |
<li><a href='../c3ref/create_function.html'>sqlite3_create_window_function</a></li> |
| 164 |
<li><a href='../c3ref/db_cacheflush.html'>sqlite3_db_cacheflush</a></li> |
| 165 |
<li><a href='../c3ref/db_config.html'>sqlite3_db_config</a></li> |
| 166 |
<li><a href='../c3ref/db_filename.html'>sqlite3_db_filename</a></li> |
| 167 |
<li><a href='../c3ref/db_mutex.html'>sqlite3_db_mutex</a></li> |
| 168 |
<li><a href='../c3ref/db_name.html'>sqlite3_db_name</a></li> |
| 169 |
<li><a href='../c3ref/db_readonly.html'>sqlite3_db_readonly</a></li> |
| 170 |
<li><a href='../c3ref/db_release_memory.html'>sqlite3_db_release_memory</a></li> |
| 171 |
<li><a href='../c3ref/db_status.html'>sqlite3_db_status</a></li> |
| 172 |
<li><a href='../c3ref/db_status.html'>sqlite3_db_status64</a></li> |
| 173 |
<li><a href='../c3ref/drop_modules.html'>sqlite3_drop_modules</a></li> |
| 174 |
<li><a href='../c3ref/enable_load_extension.html'>sqlite3_enable_load_extension</a></li> |
| 175 |
<li><a href='../c3ref/errcode.html'>sqlite3_errcode</a></li> |
| 176 |
<li><a href='../c3ref/errcode.html'>sqlite3_errmsg</a></li> |
| 177 |
<li><a href='../c3ref/errcode.html'>sqlite3_errmsg16</a></li> |
| 178 |
<li><a href='../c3ref/errcode.html'>sqlite3_error_offset</a></li> |
| 179 |
<li><a href='../c3ref/errcode.html'>sqlite3_errstr</a></li> |
| 180 |
<li><a href='../c3ref/exec.html'>sqlite3_exec</a></li> |
| 181 |
<li><a href='../c3ref/errcode.html'>sqlite3_extended_errcode</a></li> |
| 182 |
<li><a href='../c3ref/extended_result_codes.html'>sqlite3_extended_result_codes</a></li> |
| 183 |
<li><a href='../c3ref/file_control.html'>sqlite3_file_control</a></li> |
| 184 |
<li><a href='../c3ref/free_table.html'>sqlite3_free_table</a></li> |
| 185 |
<li><a href='../c3ref/get_autocommit.html'>sqlite3_get_autocommit</a></li> |
| 186 |
<li><a href='../c3ref/get_clientdata.html'>sqlite3_get_clientdata</a></li> |
| 187 |
<li><a href='../c3ref/free_table.html'>sqlite3_get_table</a></li> |
| 188 |
<li><a href='../c3ref/interrupt.html'>sqlite3_interrupt</a></li> |
| 189 |
<li><a href='../c3ref/interrupt.html'>sqlite3_is_interrupted</a></li> |
| 190 |
<li><a href='../c3ref/last_insert_rowid.html'>sqlite3_last_insert_rowid</a></li> |
| 191 |
<li><a href='../c3ref/limit.html'>sqlite3_limit</a></li> |
| 192 |
<li><a href='../c3ref/load_extension.html'>sqlite3_load_extension</a></li> |
| 193 |
<li><a href='../c3ref/next_stmt.html'>sqlite3_next_stmt</a></li> |
| 194 |
<li><a href='../c3ref/overload_function.html'>sqlite3_overload_function</a></li> |
| 195 |
<li><a href='../c3ref/prepare.html'>sqlite3_prepare</a></li> |
| 196 |
<li><a href='../c3ref/prepare.html'>sqlite3_prepare16</a></li> |
| 197 |
<li><a href='../c3ref/prepare.html'>sqlite3_prepare16_v2</a></li> |
| 198 |
<li><a href='../c3ref/prepare.html'>sqlite3_prepare16_v3</a></li> |
| 199 |
<li><a href='../c3ref/prepare.html'>sqlite3_prepare_v2</a></li> |
| 200 |
<li><a href='../c3ref/prepare.html'>sqlite3_prepare_v3</a></li> |
| 201 |
<li><a href='../c3ref/preupdate_blobwrite.html'>sqlite3_preupdate_blobwrite</a></li> |
| 202 |
<li><a href='../c3ref/preupdate_blobwrite.html'>sqlite3_preupdate_count</a></li> |
| 203 |
<li><a href='../c3ref/preupdate_blobwrite.html'>sqlite3_preupdate_depth</a></li> |
| 204 |
<li><a href='../c3ref/preupdate_blobwrite.html'>sqlite3_preupdate_hook</a></li> |
| 205 |
<li><a href='../c3ref/preupdate_blobwrite.html'>sqlite3_preupdate_new</a></li> |
| 206 |
<li><a href='../c3ref/preupdate_blobwrite.html'>sqlite3_preupdate_old</a></li> |
| 207 |
<li><a href='../c3ref/progress_handler.html'>sqlite3_progress_handler</a></li> |
| 208 |
<li><a href='../c3ref/commit_hook.html'>sqlite3_rollback_hook</a></li> |
| 209 |
<li><a href='../c3ref/set_authorizer.html'>sqlite3_set_authorizer</a></li> |
| 210 |
<li><a href='../c3ref/get_clientdata.html'>sqlite3_set_clientdata</a></li> |
| 211 |
<li><a href='../c3ref/set_errmsg.html'>sqlite3_set_errmsg</a></li> |
| 212 |
<li><a href='../c3ref/set_last_insert_rowid.html'>sqlite3_set_last_insert_rowid</a></li> |
| 213 |
<li><a href='../c3ref/setlk_timeout.html'>sqlite3_setlk_timeout</a></li> |
| 214 |
<li><a href='../c3ref/system_errno.html'>sqlite3_system_errno</a></li> |
| 215 |
<li><a href='../c3ref/table_column_metadata.html'>sqlite3_table_column_metadata</a></li> |
| 216 |
<li><a href='../c3ref/total_changes.html'>sqlite3_total_changes</a></li> |
| 217 |
<li><a href='../c3ref/total_changes.html'>sqlite3_total_changes64</a></li> |
| 218 |
<li><a href='../c3ref/trace_v2.html'>sqlite3_trace_v2</a></li> |
| 219 |
<li><a href='../c3ref/txn_state.html'>sqlite3_txn_state</a></li> |
| 220 |
<li><a href='../c3ref/unlock_notify.html'>sqlite3_unlock_notify</a></li> |
| 221 |
<li><a href='../c3ref/update_hook.html'>sqlite3_update_hook</a></li> |
| 222 |
<li><a href='../c3ref/wal_autocheckpoint.html'>sqlite3_wal_autocheckpoint</a></li> |
| 223 |
<li><a href='../c3ref/wal_checkpoint.html'>sqlite3_wal_checkpoint</a></li> |
| 224 |
<li><a href='../c3ref/wal_checkpoint_v2.html'>sqlite3_wal_checkpoint_v2</a></li> |
| 225 |
<li><a href='../c3ref/wal_hook.html'>sqlite3_wal_hook</a></li> |
| 226 |
</ul> |
| 227 |
</div> |
| 228 |
</p> |
| 229 |
<p>See also lists of |
| 230 |
<a href="../c3ref/objlist.html">Objects</a>, |
| 231 |
<a href="../c3ref/constlist.html">Constants</a>, and |
| 232 |
<a href="../c3ref/funclist.html">Functions</a>.</p> |
| 233 |
|