You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1245 lines
48 KiB

8 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="theme-color" content="#375EAB">
  7. <title>sqlite3 - The Go Programming Language</title>
  8. <link type="text/css" rel="stylesheet" href="../../../../lib/godoc/style.css">
  9. <link rel="stylesheet" href="../../../../lib/godoc/jquery.treeview.css">
  10. <script type="text/javascript">window.initFuncs = [];</script>
  11. </head>
  12. <body>
  13. <div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
  14. ...
  15. </div><!-- #lowframe -->
  16. <div id="topbar" class="wide"><div class="container">
  17. <div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
  18. <div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
  19. <a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
  20. <form method="GET" action="http://localhost:6060/search">
  21. <div id="menu">
  22. <a href="http://localhost:6060/doc/">Documents</a>
  23. <a href="http://localhost:6060/pkg/">Packages</a>
  24. <a href="http://localhost:6060/project/">The Project</a>
  25. <a href="http://localhost:6060/help/">Help</a>
  26. <a href="http://localhost:6060/blog/">Blog</a>
  27. <input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
  28. </div>
  29. </form>
  30. </div></div>
  31. <div id="page" class="wide">
  32. <div class="container">
  33. <h1>Package sqlite3</h1>
  34. <div id="nav"></div>
  35. <!--
  36. Copyright 2009 The Go Authors. All rights reserved.
  37. Use of this source code is governed by a BSD-style
  38. license that can be found in the LICENSE file.
  39. -->
  40. <!--
  41. Note: Static (i.e., not template-generated) href and id
  42. attributes start with "pkg-" to make it impossible for
  43. them to conflict with generated attributes (some of which
  44. correspond to Go identifiers).
  45. -->
  46. <script type='text/javascript'>
  47. document.ANALYSIS_DATA = null;
  48. document.CALLGRAPH = null;
  49. </script>
  50. <div id="short-nav">
  51. <dl>
  52. <dd><code>import "github.com/mattn/go-sqlite3"</code></dd>
  53. </dl>
  54. <dl>
  55. <dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
  56. <dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
  57. <dd><a href="index.html#pkg-subdirectories">Subdirectories</a></dd>
  58. </dl>
  59. </div>
  60. <!-- The package's Name is printed as title by the top-level template -->
  61. <div id="pkg-overview" class="toggleVisible">
  62. <div class="collapsed">
  63. <h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
  64. </div>
  65. <div class="expanded">
  66. <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
  67. <p>
  68. Package sqlite3 provides interface to SQLite3 databases.
  69. </p>
  70. <p>
  71. This works as a driver for database/sql.
  72. </p>
  73. <p>
  74. Installation
  75. </p>
  76. <pre>go get github.com/mattn/go-sqlite3
  77. </pre>
  78. <h3 id="hdr-Supported_Types">Supported Types</h3>
  79. <p>
  80. Currently, go-sqlite3 supports the following data types.
  81. </p>
  82. <pre>+------------------------------+
  83. |go | sqlite3 |
  84. |----------|-------------------|
  85. |nil | null |
  86. |int | integer |
  87. |int64 | integer |
  88. |float64 | float |
  89. |bool | integer |
  90. |[]byte | blob |
  91. |string | text |
  92. |time.Time | timestamp/datetime|
  93. +------------------------------+
  94. </pre>
  95. <h3 id="hdr-SQLite3_Extension">SQLite3 Extension</h3>
  96. <p>
  97. You can write your own extension module for sqlite3. For example, below is an
  98. extension for a Regexp matcher operation.
  99. </p>
  100. <pre>#include &lt;pcre.h&gt;
  101. #include &lt;string.h&gt;
  102. #include &lt;stdio.h&gt;
  103. #include &lt;sqlite3ext.h&gt;
  104. SQLITE_EXTENSION_INIT1
  105. static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
  106. if (argc &gt;= 2) {
  107. const char *target = (const char *)sqlite3_value_text(argv[1]);
  108. const char *pattern = (const char *)sqlite3_value_text(argv[0]);
  109. const char* errstr = NULL;
  110. int erroff = 0;
  111. int vec[500];
  112. int n, rc;
  113. pcre* re = pcre_compile(pattern, 0, &amp;errstr, &amp;erroff, NULL);
  114. rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
  115. if (rc &lt;= 0) {
  116. sqlite3_result_error(context, errstr, 0);
  117. return;
  118. }
  119. sqlite3_result_int(context, 1);
  120. }
  121. }
  122. #ifdef _WIN32
  123. __declspec(dllexport)
  124. #endif
  125. int sqlite3_extension_init(sqlite3 *db, char **errmsg,
  126. const sqlite3_api_routines *api) {
  127. SQLITE_EXTENSION_INIT2(api);
  128. return sqlite3_create_function(db, &#34;regexp&#34;, 2, SQLITE_UTF8,
  129. (void*)db, regexp_func, NULL, NULL);
  130. }
  131. </pre>
  132. <p>
  133. It needs to be built as a so/dll shared library. And you need to register
  134. the extension module like below.
  135. </p>
  136. <pre>sql.Register(&#34;sqlite3_with_extensions&#34;,
  137. &amp;sqlite3.SQLiteDriver{
  138. Extensions: []string{
  139. &#34;sqlite3_mod_regexp&#34;,
  140. },
  141. })
  142. </pre>
  143. <p>
  144. Then, you can use this extension.
  145. </p>
  146. <pre>rows, err := db.Query(&#34;select text from mytable where name regexp &#39;^golang&#39;&#34;)
  147. </pre>
  148. <h3 id="hdr-Connection_Hook">Connection Hook</h3>
  149. <p>
  150. You can hook and inject your code when the connection is established. database/sql
  151. doesn&#39;t provide a way to get native go-sqlite3 interfaces. So if you want,
  152. you need to set ConnectHook and get the SQLiteConn.
  153. </p>
  154. <pre>sql.Register(&#34;sqlite3_with_hook_example&#34;,
  155. &amp;sqlite3.SQLiteDriver{
  156. ConnectHook: func(conn *sqlite3.SQLiteConn) error {
  157. sqlite3conn = append(sqlite3conn, conn)
  158. return nil
  159. },
  160. })
  161. </pre>
  162. <h3 id="hdr-Go_SQlite3_Extensions">Go SQlite3 Extensions</h3>
  163. <p>
  164. If you want to register Go functions as SQLite extension functions,
  165. call RegisterFunction from ConnectHook.
  166. </p>
  167. <pre>regex = func(re, s string) (bool, error) {
  168. return regexp.MatchString(re, s)
  169. }
  170. sql.Register(&#34;sqlite3_with_go_func&#34;,
  171. &amp;sqlite3.SQLiteDriver{
  172. ConnectHook: func(conn *sqlite3.SQLiteConn) error {
  173. return conn.RegisterFunc(&#34;regexp&#34;, regex, true)
  174. },
  175. })
  176. </pre>
  177. <p>
  178. See the documentation of RegisterFunc for more details.
  179. </p>
  180. </div>
  181. </div>
  182. <div id="pkg-index" class="toggleVisible">
  183. <div class="collapsed">
  184. <h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
  185. </div>
  186. <div class="expanded">
  187. <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
  188. <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
  189. <div id="manual-nav">
  190. <dl>
  191. <dd><a href="index.html#pkg-constants">Constants</a></dd>
  192. <dd><a href="index.html#pkg-variables">Variables</a></dd>
  193. <dd><a href="index.html#Version">func Version() (libVersion string, libVersionNumber int, sourceId string)</a></dd>
  194. <dd><a href="index.html#ErrNo">type ErrNo</a></dd>
  195. <dd>&nbsp; &nbsp; <a href="index.html#ErrNo.Error">func (err ErrNo) Error() string</a></dd>
  196. <dd>&nbsp; &nbsp; <a href="index.html#ErrNo.Extend">func (err ErrNo) Extend(by int) ErrNoExtended</a></dd>
  197. <dd><a href="index.html#ErrNoExtended">type ErrNoExtended</a></dd>
  198. <dd>&nbsp; &nbsp; <a href="index.html#ErrNoExtended.Error">func (err ErrNoExtended) Error() string</a></dd>
  199. <dd><a href="index.html#Error">type Error</a></dd>
  200. <dd>&nbsp; &nbsp; <a href="index.html#Error.Error">func (err Error) Error() string</a></dd>
  201. <dd><a href="index.html#SQLiteBackup">type SQLiteBackup</a></dd>
  202. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteBackup.Close">func (b *SQLiteBackup) Close() error</a></dd>
  203. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteBackup.Finish">func (b *SQLiteBackup) Finish() error</a></dd>
  204. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteBackup.PageCount">func (b *SQLiteBackup) PageCount() int</a></dd>
  205. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteBackup.Remaining">func (b *SQLiteBackup) Remaining() int</a></dd>
  206. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteBackup.Step">func (b *SQLiteBackup) Step(p int) (bool, error)</a></dd>
  207. <dd><a href="index.html#SQLiteConn">type SQLiteConn</a></dd>
  208. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.AutoCommit">func (c *SQLiteConn) AutoCommit() bool</a></dd>
  209. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.Backup">func (c *SQLiteConn) Backup(dest string, conn *SQLiteConn, src string) (*SQLiteBackup, error)</a></dd>
  210. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.Begin">func (c *SQLiteConn) Begin() (driver.Tx, error)</a></dd>
  211. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.Close">func (c *SQLiteConn) Close() error</a></dd>
  212. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.Exec">func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error)</a></dd>
  213. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.LoadExtension">func (c *SQLiteConn) LoadExtension(lib string, entry string) error</a></dd>
  214. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.Prepare">func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error)</a></dd>
  215. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.Query">func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error)</a></dd>
  216. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.RegisterAggregator">func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool) error</a></dd>
  217. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteConn.RegisterFunc">func (c *SQLiteConn) RegisterFunc(name string, impl interface{}, pure bool) error</a></dd>
  218. <dd><a href="index.html#SQLiteDriver">type SQLiteDriver</a></dd>
  219. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteDriver.Open">func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error)</a></dd>
  220. <dd><a href="index.html#SQLiteResult">type SQLiteResult</a></dd>
  221. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteResult.LastInsertId">func (r *SQLiteResult) LastInsertId() (int64, error)</a></dd>
  222. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteResult.RowsAffected">func (r *SQLiteResult) RowsAffected() (int64, error)</a></dd>
  223. <dd><a href="index.html#SQLiteRows">type SQLiteRows</a></dd>
  224. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteRows.Close">func (rc *SQLiteRows) Close() error</a></dd>
  225. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteRows.Columns">func (rc *SQLiteRows) Columns() []string</a></dd>
  226. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteRows.DeclTypes">func (rc *SQLiteRows) DeclTypes() []string</a></dd>
  227. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteRows.Next">func (rc *SQLiteRows) Next(dest []driver.Value) error</a></dd>
  228. <dd><a href="index.html#SQLiteStmt">type SQLiteStmt</a></dd>
  229. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteStmt.Close">func (s *SQLiteStmt) Close() error</a></dd>
  230. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteStmt.Exec">func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error)</a></dd>
  231. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteStmt.NumInput">func (s *SQLiteStmt) NumInput() int</a></dd>
  232. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteStmt.Query">func (s *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error)</a></dd>
  233. <dd><a href="index.html#SQLiteTx">type SQLiteTx</a></dd>
  234. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteTx.Commit">func (tx *SQLiteTx) Commit() error</a></dd>
  235. <dd>&nbsp; &nbsp; <a href="index.html#SQLiteTx.Rollback">func (tx *SQLiteTx) Rollback() error</a></dd>
  236. </dl>
  237. </div><!-- #manual-nav -->
  238. <h4>Package files</h4>
  239. <p>
  240. <span style="font-size:90%">
  241. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go">backup.go</a>
  242. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/callback.go">callback.go</a>
  243. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/doc.go">doc.go</a>
  244. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go">error.go</a>
  245. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go">sqlite3.go</a>
  246. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3_load_extension.go">sqlite3_load_extension.go</a>
  247. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3_other.go">sqlite3_other.go</a>
  248. <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/tracecallback_noimpl.go">tracecallback_noimpl.go</a>
  249. </span>
  250. </p>
  251. </div><!-- .expanded -->
  252. </div><!-- #pkg-index -->
  253. <div id="pkg-callgraph" class="toggle" style="display: none">
  254. <div class="collapsed">
  255. <h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
  256. </div> <!-- .expanded -->
  257. <div class="expanded">
  258. <h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
  259. <p>
  260. In the call graph viewer below, each node
  261. is a function belonging to this package
  262. and its children are the functions it
  263. calls&mdash;perhaps dynamically.
  264. </p>
  265. <p>
  266. The root nodes are the entry points of the
  267. package: functions that may be called from
  268. outside the package.
  269. There may be non-exported or anonymous
  270. functions among them if they are called
  271. dynamically from another package.
  272. </p>
  273. <p>
  274. Click a node to visit that function's source code.
  275. From there you can visit its callers by
  276. clicking its declaring <code>func</code>
  277. token.
  278. </p>
  279. <p>
  280. Functions may be omitted if they were
  281. determined to be unreachable in the
  282. particular programs or tests that were
  283. analyzed.
  284. </p>
  285. <!-- Zero means show all package entry points. -->
  286. <ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
  287. </div>
  288. </div> <!-- #pkg-callgraph -->
  289. <h2 id="pkg-constants">Constants</h2>
  290. <pre>const <span id="ErrNoMask">ErrNoMask</span> <a href="../../../C/index.html">C</a>.<a href="../../../C/index.html#int">int</a> = 0xff</pre>
  291. <h2 id="pkg-variables">Variables</h2>
  292. <pre>var (
  293. <span id="ErrError">ErrError</span> = <a href="index.html#ErrNo">ErrNo</a>(1) <span class="comment">/* SQL error or missing database */</span>
  294. <span id="ErrInternal">ErrInternal</span> = <a href="index.html#ErrNo">ErrNo</a>(2) <span class="comment">/* Internal logic error in SQLite */</span>
  295. <span id="ErrPerm">ErrPerm</span> = <a href="index.html#ErrNo">ErrNo</a>(3) <span class="comment">/* Access permission denied */</span>
  296. <span id="ErrAbort">ErrAbort</span> = <a href="index.html#ErrNo">ErrNo</a>(4) <span class="comment">/* Callback routine requested an abort */</span>
  297. <span id="ErrBusy">ErrBusy</span> = <a href="index.html#ErrNo">ErrNo</a>(5) <span class="comment">/* The database file is locked */</span>
  298. <span id="ErrLocked">ErrLocked</span> = <a href="index.html#ErrNo">ErrNo</a>(6) <span class="comment">/* A table in the database is locked */</span>
  299. <span id="ErrNomem">ErrNomem</span> = <a href="index.html#ErrNo">ErrNo</a>(7) <span class="comment">/* A malloc() failed */</span>
  300. <span id="ErrReadonly">ErrReadonly</span> = <a href="index.html#ErrNo">ErrNo</a>(8) <span class="comment">/* Attempt to write a readonly database */</span>
  301. <span id="ErrInterrupt">ErrInterrupt</span> = <a href="index.html#ErrNo">ErrNo</a>(9) <span class="comment">/* Operation terminated by sqlite3_interrupt() */</span>
  302. <span id="ErrIoErr">ErrIoErr</span> = <a href="index.html#ErrNo">ErrNo</a>(10) <span class="comment">/* Some kind of disk I/O error occurred */</span>
  303. <span id="ErrCorrupt">ErrCorrupt</span> = <a href="index.html#ErrNo">ErrNo</a>(11) <span class="comment">/* The database disk image is malformed */</span>
  304. <span id="ErrNotFound">ErrNotFound</span> = <a href="index.html#ErrNo">ErrNo</a>(12) <span class="comment">/* Unknown opcode in sqlite3_file_control() */</span>
  305. <span id="ErrFull">ErrFull</span> = <a href="index.html#ErrNo">ErrNo</a>(13) <span class="comment">/* Insertion failed because database is full */</span>
  306. <span id="ErrCantOpen">ErrCantOpen</span> = <a href="index.html#ErrNo">ErrNo</a>(14) <span class="comment">/* Unable to open the database file */</span>
  307. <span id="ErrProtocol">ErrProtocol</span> = <a href="index.html#ErrNo">ErrNo</a>(15) <span class="comment">/* Database lock protocol error */</span>
  308. <span id="ErrEmpty">ErrEmpty</span> = <a href="index.html#ErrNo">ErrNo</a>(16) <span class="comment">/* Database is empty */</span>
  309. <span id="ErrSchema">ErrSchema</span> = <a href="index.html#ErrNo">ErrNo</a>(17) <span class="comment">/* The database schema changed */</span>
  310. <span id="ErrTooBig">ErrTooBig</span> = <a href="index.html#ErrNo">ErrNo</a>(18) <span class="comment">/* String or BLOB exceeds size limit */</span>
  311. <span id="ErrConstraint">ErrConstraint</span> = <a href="index.html#ErrNo">ErrNo</a>(19) <span class="comment">/* Abort due to constraint violation */</span>
  312. <span id="ErrMismatch">ErrMismatch</span> = <a href="index.html#ErrNo">ErrNo</a>(20) <span class="comment">/* Data type mismatch */</span>
  313. <span id="ErrMisuse">ErrMisuse</span> = <a href="index.html#ErrNo">ErrNo</a>(21) <span class="comment">/* Library used incorrectly */</span>
  314. <span id="ErrNoLFS">ErrNoLFS</span> = <a href="index.html#ErrNo">ErrNo</a>(22) <span class="comment">/* Uses OS features not supported on host */</span>
  315. <span id="ErrAuth">ErrAuth</span> = <a href="index.html#ErrNo">ErrNo</a>(23) <span class="comment">/* Authorization denied */</span>
  316. <span id="ErrFormat">ErrFormat</span> = <a href="index.html#ErrNo">ErrNo</a>(24) <span class="comment">/* Auxiliary database format error */</span>
  317. <span id="ErrRange">ErrRange</span> = <a href="index.html#ErrNo">ErrNo</a>(25) <span class="comment">/* 2nd parameter to sqlite3_bind out of range */</span>
  318. <span id="ErrNotADB">ErrNotADB</span> = <a href="index.html#ErrNo">ErrNo</a>(26) <span class="comment">/* File opened that is not a database file */</span>
  319. <span id="ErrNotice">ErrNotice</span> = <a href="index.html#ErrNo">ErrNo</a>(27) <span class="comment">/* Notifications from sqlite3_log() */</span>
  320. <span id="ErrWarning">ErrWarning</span> = <a href="index.html#ErrNo">ErrNo</a>(28) <span class="comment">/* Warnings from sqlite3_log() */</span>
  321. )</pre>
  322. <p>
  323. result codes from <a href="http://www.sqlite.org/c3ref/c_abort.html">http://www.sqlite.org/c3ref/c_abort.html</a>
  324. </p>
  325. <pre>var (
  326. <span id="ErrIoErrRead">ErrIoErrRead</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(1)
  327. <span id="ErrIoErrShortRead">ErrIoErrShortRead</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(2)
  328. <span id="ErrIoErrWrite">ErrIoErrWrite</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(3)
  329. <span id="ErrIoErrFsync">ErrIoErrFsync</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(4)
  330. <span id="ErrIoErrDirFsync">ErrIoErrDirFsync</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(5)
  331. <span id="ErrIoErrTruncate">ErrIoErrTruncate</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(6)
  332. <span id="ErrIoErrFstat">ErrIoErrFstat</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(7)
  333. <span id="ErrIoErrUnlock">ErrIoErrUnlock</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(8)
  334. <span id="ErrIoErrRDlock">ErrIoErrRDlock</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(9)
  335. <span id="ErrIoErrDelete">ErrIoErrDelete</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(10)
  336. <span id="ErrIoErrBlocked">ErrIoErrBlocked</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(11)
  337. <span id="ErrIoErrNoMem">ErrIoErrNoMem</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(12)
  338. <span id="ErrIoErrAccess">ErrIoErrAccess</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(13)
  339. <span id="ErrIoErrCheckReservedLock">ErrIoErrCheckReservedLock</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(14)
  340. <span id="ErrIoErrLock">ErrIoErrLock</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(15)
  341. <span id="ErrIoErrClose">ErrIoErrClose</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(16)
  342. <span id="ErrIoErrDirClose">ErrIoErrDirClose</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(17)
  343. <span id="ErrIoErrSHMOpen">ErrIoErrSHMOpen</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(18)
  344. <span id="ErrIoErrSHMSize">ErrIoErrSHMSize</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(19)
  345. <span id="ErrIoErrSHMLock">ErrIoErrSHMLock</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(20)
  346. <span id="ErrIoErrSHMMap">ErrIoErrSHMMap</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(21)
  347. <span id="ErrIoErrSeek">ErrIoErrSeek</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(22)
  348. <span id="ErrIoErrDeleteNoent">ErrIoErrDeleteNoent</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(23)
  349. <span id="ErrIoErrMMap">ErrIoErrMMap</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(24)
  350. <span id="ErrIoErrGetTempPath">ErrIoErrGetTempPath</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(25)
  351. <span id="ErrIoErrConvPath">ErrIoErrConvPath</span> = <a href="index.html#ErrIoErr">ErrIoErr</a>.<a href="index.html#Extend">Extend</a>(26)
  352. <span id="ErrLockedSharedCache">ErrLockedSharedCache</span> = <a href="index.html#ErrLocked">ErrLocked</a>.<a href="index.html#Extend">Extend</a>(1)
  353. <span id="ErrBusyRecovery">ErrBusyRecovery</span> = <a href="index.html#ErrBusy">ErrBusy</a>.<a href="index.html#Extend">Extend</a>(1)
  354. <span id="ErrBusySnapshot">ErrBusySnapshot</span> = <a href="index.html#ErrBusy">ErrBusy</a>.<a href="index.html#Extend">Extend</a>(2)
  355. <span id="ErrCantOpenNoTempDir">ErrCantOpenNoTempDir</span> = <a href="index.html#ErrCantOpen">ErrCantOpen</a>.<a href="index.html#Extend">Extend</a>(1)
  356. <span id="ErrCantOpenIsDir">ErrCantOpenIsDir</span> = <a href="index.html#ErrCantOpen">ErrCantOpen</a>.<a href="index.html#Extend">Extend</a>(2)
  357. <span id="ErrCantOpenFullPath">ErrCantOpenFullPath</span> = <a href="index.html#ErrCantOpen">ErrCantOpen</a>.<a href="index.html#Extend">Extend</a>(3)
  358. <span id="ErrCantOpenConvPath">ErrCantOpenConvPath</span> = <a href="index.html#ErrCantOpen">ErrCantOpen</a>.<a href="index.html#Extend">Extend</a>(4)
  359. <span id="ErrCorruptVTab">ErrCorruptVTab</span> = <a href="index.html#ErrCorrupt">ErrCorrupt</a>.<a href="index.html#Extend">Extend</a>(1)
  360. <span id="ErrReadonlyRecovery">ErrReadonlyRecovery</span> = <a href="index.html#ErrReadonly">ErrReadonly</a>.<a href="index.html#Extend">Extend</a>(1)
  361. <span id="ErrReadonlyCantLock">ErrReadonlyCantLock</span> = <a href="index.html#ErrReadonly">ErrReadonly</a>.<a href="index.html#Extend">Extend</a>(2)
  362. <span id="ErrReadonlyRollback">ErrReadonlyRollback</span> = <a href="index.html#ErrReadonly">ErrReadonly</a>.<a href="index.html#Extend">Extend</a>(3)
  363. <span id="ErrReadonlyDbMoved">ErrReadonlyDbMoved</span> = <a href="index.html#ErrReadonly">ErrReadonly</a>.<a href="index.html#Extend">Extend</a>(4)
  364. <span id="ErrAbortRollback">ErrAbortRollback</span> = <a href="index.html#ErrAbort">ErrAbort</a>.<a href="index.html#Extend">Extend</a>(2)
  365. <span id="ErrConstraintCheck">ErrConstraintCheck</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(1)
  366. <span id="ErrConstraintCommitHook">ErrConstraintCommitHook</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(2)
  367. <span id="ErrConstraintForeignKey">ErrConstraintForeignKey</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(3)
  368. <span id="ErrConstraintFunction">ErrConstraintFunction</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(4)
  369. <span id="ErrConstraintNotNull">ErrConstraintNotNull</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(5)
  370. <span id="ErrConstraintPrimaryKey">ErrConstraintPrimaryKey</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(6)
  371. <span id="ErrConstraintTrigger">ErrConstraintTrigger</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(7)
  372. <span id="ErrConstraintUnique">ErrConstraintUnique</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(8)
  373. <span id="ErrConstraintVTab">ErrConstraintVTab</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(9)
  374. <span id="ErrConstraintRowId">ErrConstraintRowId</span> = <a href="index.html#ErrConstraint">ErrConstraint</a>.<a href="index.html#Extend">Extend</a>(10)
  375. <span id="ErrNoticeRecoverWAL">ErrNoticeRecoverWAL</span> = <a href="index.html#ErrNotice">ErrNotice</a>.<a href="index.html#Extend">Extend</a>(1)
  376. <span id="ErrNoticeRecoverRollback">ErrNoticeRecoverRollback</span> = <a href="index.html#ErrNotice">ErrNotice</a>.<a href="index.html#Extend">Extend</a>(2)
  377. <span id="ErrWarningAutoIndex">ErrWarningAutoIndex</span> = <a href="index.html#ErrWarning">ErrWarning</a>.<a href="index.html#Extend">Extend</a>(1)
  378. )</pre>
  379. <p>
  380. result codes from <a href="http://www.sqlite.org/c3ref/c_abort_rollback.html">http://www.sqlite.org/c3ref/c_abort_rollback.html</a>
  381. </p>
  382. <pre>var <span id="SQLiteTimestampFormats">SQLiteTimestampFormats</span> = []<a href="../../../builtin/index.html#string">string</a>{
  383. &#34;2006-01-02 15:04:05.999999999-07:00&#34;,
  384. &#34;2006-01-02T15:04:05.999999999-07:00&#34;,
  385. &#34;2006-01-02 15:04:05.999999999&#34;,
  386. &#34;2006-01-02T15:04:05.999999999&#34;,
  387. &#34;2006-01-02 15:04:05&#34;,
  388. &#34;2006-01-02T15:04:05&#34;,
  389. &#34;2006-01-02 15:04&#34;,
  390. &#34;2006-01-02T15:04&#34;,
  391. &#34;2006-01-02&#34;,
  392. }</pre>
  393. <p>
  394. Timestamp formats understood by both this module and SQLite.
  395. The first format in the slice will be used when saving time values
  396. into the database. When parsing a string from a timestamp or
  397. datetime column, the formats are tried in order.
  398. </p>
  399. <h2 id="Version">func <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=3607:3680#L132">Version</a></h2>
  400. <pre>func Version() (libVersion <a href="../../../builtin/index.html#string">string</a>, libVersionNumber <a href="../../../builtin/index.html#int">int</a>, sourceId <a href="../../../builtin/index.html#string">string</a>)</pre>
  401. <p>
  402. Version returns SQLite library version information.
  403. </p>
  404. <h2 id="ErrNo">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=201:215#L1">ErrNo</a></h2>
  405. <pre>type ErrNo <a href="../../../builtin/index.html#int">int</a></pre>
  406. <h3 id="ErrNo.Error">func (ErrNo) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=2457:2488#L45">Error</a></h3>
  407. <pre>func (err <a href="index.html#ErrNo">ErrNo</a>) Error() <a href="../../../builtin/index.html#string">string</a></pre>
  408. <h3 id="ErrNo.Extend">func (ErrNo) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=2527:2572#L49">Extend</a></h3>
  409. <pre>func (err <a href="index.html#ErrNo">ErrNo</a>) Extend(by <a href="../../../builtin/index.html#int">int</a>) <a href="index.html#ErrNoExtended">ErrNoExtended</a></pre>
  410. <h2 id="ErrNoExtended">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=247:269#L4">ErrNoExtended</a></h2>
  411. <pre>type ErrNoExtended <a href="../../../builtin/index.html#int">int</a></pre>
  412. <h3 id="ErrNoExtended.Error">func (ErrNoExtended) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=2622:2661#L53">Error</a></h3>
  413. <pre>func (err <a href="index.html#ErrNoExtended">ErrNoExtended</a>) Error() <a href="../../../builtin/index.html#string">string</a></pre>
  414. <h2 id="Error">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=271:564#L6">Error</a></h2>
  415. <pre>type Error struct {
  416. Code <a href="index.html#ErrNo">ErrNo</a> <span class="comment">/* The error code returned by SQLite */</span>
  417. ExtendedCode <a href="index.html#ErrNoExtended">ErrNoExtended</a> <span class="comment">/* The extended error code returned by SQLite */</span>
  418. <span class="comment">// contains filtered or unexported fields</span>
  419. }</pre>
  420. <h3 id="Error.Error">func (Error) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/error.go?s=2745:2776#L57">Error</a></h3>
  421. <pre>func (err <a href="index.html#Error">Error</a>) Error() <a href="../../../builtin/index.html#string">string</a></pre>
  422. <h2 id="SQLiteBackup">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=345:394#L12">SQLiteBackup</a></h2>
  423. <pre>type SQLiteBackup struct {
  424. <span class="comment">// contains filtered or unexported fields</span>
  425. }</pre>
  426. <h3 id="SQLiteBackup.Close">func (*SQLiteBackup) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=1617:1653#L56">Close</a></h3>
  427. <pre>func (b *<a href="index.html#SQLiteBackup">SQLiteBackup</a>) Close() <a href="../../../builtin/index.html#error">error</a></pre>
  428. <h3 id="SQLiteBackup.Finish">func (*SQLiteBackup) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=1556:1593#L52">Finish</a></h3>
  429. <pre>func (b *<a href="index.html#SQLiteBackup">SQLiteBackup</a>) Finish() <a href="../../../builtin/index.html#error">error</a></pre>
  430. <h3 id="SQLiteBackup.PageCount">func (*SQLiteBackup) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=1467:1505#L48">PageCount</a></h3>
  431. <pre>func (b *<a href="index.html#SQLiteBackup">SQLiteBackup</a>) PageCount() <a href="../../../builtin/index.html#int">int</a></pre>
  432. <h3 id="SQLiteBackup.Remaining">func (*SQLiteBackup) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=1378:1416#L44">Remaining</a></h3>
  433. <pre>func (b *<a href="index.html#SQLiteBackup">SQLiteBackup</a>) Remaining() <a href="../../../builtin/index.html#int">int</a></pre>
  434. <h3 id="SQLiteBackup.Step">func (*SQLiteBackup) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=1099:1147#L34">Step</a></h3>
  435. <pre>func (b *<a href="index.html#SQLiteBackup">SQLiteBackup</a>) Step(p <a href="../../../builtin/index.html#int">int</a>) (<a href="../../../builtin/index.html#bool">bool</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  436. <p>
  437. Backs up for one step. Calls the underlying `sqlite3_backup_step` function.
  438. This function returns a boolean indicating if the backup is done and
  439. an error signalling any other error. Done is returned if the underlying C
  440. function returns SQLITE_DONE (Code 101)
  441. </p>
  442. <h2 id="SQLiteConn">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=4005:4156#L146">SQLiteConn</a></h2>
  443. <pre>type SQLiteConn struct {
  444. <span class="comment">// contains filtered or unexported fields</span>
  445. }</pre>
  446. <p>
  447. Conn struct.
  448. </p>
  449. <h3 id="SQLiteConn.AutoCommit">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=9937:9975#L382">AutoCommit</a></h3>
  450. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) AutoCommit() <a href="../../../builtin/index.html#bool">bool</a></pre>
  451. <p>
  452. AutoCommit return which currently auto commit or not.
  453. </p>
  454. <h3 id="SQLiteConn.Backup">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/backup.go?s=396:489#L16">Backup</a></h3>
  455. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) Backup(dest <a href="../../../builtin/index.html#string">string</a>, conn *<a href="index.html#SQLiteConn">SQLiteConn</a>, src <a href="../../../builtin/index.html#string">string</a>) (*<a href="index.html#SQLiteBackup">SQLiteBackup</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  456. <h3 id="SQLiteConn.Begin">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=11890:11937#L468">Begin</a></h3>
  457. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) Begin() (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Tx">Tx</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  458. <p>
  459. Begin transaction.
  460. </p>
  461. <h3 id="SQLiteConn.Close">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=14757:14791#L586">Close</a></h3>
  462. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) Close() <a href="../../../builtin/index.html#error">error</a></pre>
  463. <p>
  464. Close the connection.
  465. </p>
  466. <h3 id="SQLiteConn.Exec">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=10278:10361#L395">Exec</a></h3>
  467. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) Exec(query <a href="../../../builtin/index.html#string">string</a>, args []<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Value">Value</a>) (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Result">Result</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  468. <p>
  469. Implements Execer
  470. </p>
  471. <h3 id="SQLiteConn.LoadExtension">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3_load_extension.go?s=976:1042#L35">LoadExtension</a></h3>
  472. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) LoadExtension(lib <a href="../../../builtin/index.html#string">string</a>, entry <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  473. <h3 id="SQLiteConn.Prepare">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=15004:15067#L598">Prepare</a></h3>
  474. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) Prepare(query <a href="../../../builtin/index.html#string">string</a>) (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Stmt">Stmt</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  475. <p>
  476. Prepare the query string. Return a new statement.
  477. </p>
  478. <h3 id="SQLiteConn.Query">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=10958:11040#L428">Query</a></h3>
  479. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) Query(query <a href="../../../builtin/index.html#string">string</a>, args []<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Value">Value</a>) (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Rows">Rows</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  480. <p>
  481. Implements Queryer
  482. </p>
  483. <h3 id="SQLiteConn.RegisterAggregator">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/tracecallback_noimpl.go?s=52:139#L1">RegisterAggregator</a></h3>
  484. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) RegisterAggregator(name <a href="../../../builtin/index.html#string">string</a>, impl interface{}, pure <a href="../../../builtin/index.html#bool">bool</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  485. <h3 id="SQLiteConn.RegisterFunc">func (*SQLiteConn) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=8242:8323#L320">RegisterFunc</a></h3>
  486. <pre>func (c *<a href="index.html#SQLiteConn">SQLiteConn</a>) RegisterFunc(name <a href="../../../builtin/index.html#string">string</a>, impl interface{}, pure <a href="../../../builtin/index.html#bool">bool</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  487. <p>
  488. RegisterFunc makes a Go function available as a SQLite function.
  489. </p>
  490. <p>
  491. The Go function can have arguments of the following types: any
  492. numeric type except complex, bool, []byte, string and
  493. interface{}. interface{} arguments are given the direct translation
  494. of the SQLite data type: int64 for INTEGER, float64 for FLOAT,
  495. []byte for BLOB, string for TEXT.
  496. </p>
  497. <p>
  498. The function can additionally be variadic, as long as the type of
  499. the variadic argument is one of the above.
  500. </p>
  501. <p>
  502. If pure is true. SQLite will assume that the function&#39;s return
  503. value depends only on its inputs, and make more aggressive
  504. optimizations in its queries.
  505. </p>
  506. <p>
  507. See _example/go_custom_funcs for a detailed example.
  508. </p>
  509. <h2 id="SQLiteDriver">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=3900:3987#L140">SQLiteDriver</a></h2>
  510. <pre>type SQLiteDriver struct {
  511. Extensions []<a href="../../../builtin/index.html#string">string</a>
  512. ConnectHook func(*<a href="index.html#SQLiteConn">SQLiteConn</a>) <a href="../../../builtin/index.html#error">error</a>
  513. }</pre>
  514. <p>
  515. Driver struct.
  516. </p>
  517. <h3 id="SQLiteDriver.Open">func (*SQLiteDriver) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=12681:12741#L493">Open</a></h3>
  518. <pre>func (d *<a href="index.html#SQLiteDriver">SQLiteDriver</a>) Open(dsn <a href="../../../builtin/index.html#string">string</a>) (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Conn">Conn</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  519. <p>
  520. Open database and return a new connection.
  521. You can specify a DSN string using a URI as the filename.
  522. </p>
  523. <pre>test.db
  524. file:test.db?cache=shared&amp;mode=memory
  525. :memory:
  526. file::memory:
  527. </pre>
  528. <p>
  529. go-sqlite3 adds the following query parameters to those used by SQLite:
  530. </p>
  531. <pre>_loc=XXX
  532. Specify location of time format. It&#39;s possible to specify &#34;auto&#34;.
  533. _busy_timeout=XXX
  534. Specify value for sqlite3_busy_timeout.
  535. _txlock=XXX
  536. Specify locking behavior for transactions. XXX can be &#34;immediate&#34;,
  537. &#34;deferred&#34;, &#34;exclusive&#34;.
  538. </pre>
  539. <h2 id="SQLiteResult">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=4389:4447#L171">SQLiteResult</a></h2>
  540. <pre>type SQLiteResult struct {
  541. <span class="comment">// contains filtered or unexported fields</span>
  542. }</pre>
  543. <p>
  544. Result struct.
  545. </p>
  546. <h3 id="SQLiteResult.LastInsertId">func (*SQLiteResult) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=18131:18183#L722">LastInsertId</a></h3>
  547. <pre>func (r *<a href="index.html#SQLiteResult">SQLiteResult</a>) LastInsertId() (<a href="../../../builtin/index.html#int64">int64</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  548. <p>
  549. Return last inserted ID.
  550. </p>
  551. <h3 id="SQLiteResult.RowsAffected">func (*SQLiteResult) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=18241:18293#L727">RowsAffected</a></h3>
  552. <pre>func (r *<a href="index.html#SQLiteResult">SQLiteResult</a>) RowsAffected() (<a href="../../../builtin/index.html#int64">int64</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  553. <p>
  554. Return how many rows affected.
  555. </p>
  556. <h2 id="SQLiteRows">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=4465:4580#L177">SQLiteRows</a></h2>
  557. <pre>type SQLiteRows struct {
  558. <span class="comment">// contains filtered or unexported fields</span>
  559. }</pre>
  560. <p>
  561. Rows struct.
  562. </p>
  563. <h3 id="SQLiteRows.Close">func (*SQLiteRows) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=18897:18932#L750">Close</a></h3>
  564. <pre>func (rc *<a href="index.html#SQLiteRows">SQLiteRows</a>) Close() <a href="../../../builtin/index.html#error">error</a></pre>
  565. <p>
  566. Close the rows.
  567. </p>
  568. <h3 id="SQLiteRows.Columns">func (*SQLiteRows) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=19132:19172#L765">Columns</a></h3>
  569. <pre>func (rc *<a href="index.html#SQLiteRows">SQLiteRows</a>) Columns() []<a href="../../../builtin/index.html#string">string</a></pre>
  570. <p>
  571. Return column names.
  572. </p>
  573. <h3 id="SQLiteRows.DeclTypes">func (*SQLiteRows) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=19386:19428#L776">DeclTypes</a></h3>
  574. <pre>func (rc *<a href="index.html#SQLiteRows">SQLiteRows</a>) DeclTypes() []<a href="../../../builtin/index.html#string">string</a></pre>
  575. <p>
  576. Return column types.
  577. </p>
  578. <h3 id="SQLiteRows.Next">func (*SQLiteRows) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=19672:19725#L787">Next</a></h3>
  579. <pre>func (rc *<a href="index.html#SQLiteRows">SQLiteRows</a>) Next(dest []<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Value">Value</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  580. <p>
  581. Move cursor to next.
  582. </p>
  583. <h2 id="SQLiteStmt">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=4229:4369#L160">SQLiteStmt</a></h2>
  584. <pre>type SQLiteStmt struct {
  585. <span class="comment">// contains filtered or unexported fields</span>
  586. }</pre>
  587. <p>
  588. Stmt struct.
  589. </p>
  590. <h3 id="SQLiteStmt.Close">func (*SQLiteStmt) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=15832:15866#L625">Close</a></h3>
  591. <pre>func (s *<a href="index.html#SQLiteStmt">SQLiteStmt</a>) Close() <a href="../../../builtin/index.html#error">error</a></pre>
  592. <p>
  593. Close the statement.
  594. </p>
  595. <h3 id="SQLiteStmt.Exec">func (*SQLiteStmt) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=18385:18454#L732">Exec</a></h3>
  596. <pre>func (s *<a href="index.html#SQLiteStmt">SQLiteStmt</a>) Exec(args []<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Value">Value</a>) (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Result">Result</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  597. <p>
  598. Execute the statement with arguments. Return result object.
  599. </p>
  600. <h3 id="SQLiteStmt.NumInput">func (*SQLiteStmt) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=16196:16231#L642">NumInput</a></h3>
  601. <pre>func (s *<a href="index.html#SQLiteStmt">SQLiteStmt</a>) NumInput() <a href="../../../builtin/index.html#int">int</a></pre>
  602. <p>
  603. Return a number of parameters.
  604. </p>
  605. <h3 id="SQLiteStmt.Query">func (*SQLiteStmt) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=17891:17959#L714">Query</a></h3>
  606. <pre>func (s *<a href="index.html#SQLiteStmt">SQLiteStmt</a>) Query(args []<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Value">Value</a>) (<a href="../../../database/sql/driver/index.html">driver</a>.<a href="../../../database/sql/driver/index.html#Rows">Rows</a>, <a href="../../../builtin/index.html#error">error</a>)</pre>
  607. <p>
  608. Query the statement with arguments. Return records.
  609. </p>
  610. <h2 id="SQLiteTx">type <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=4172:4211#L155">SQLiteTx</a></h2>
  611. <pre>type SQLiteTx struct {
  612. <span class="comment">// contains filtered or unexported fields</span>
  613. }</pre>
  614. <p>
  615. Tx struct.
  616. </p>
  617. <h3 id="SQLiteTx.Commit">func (*SQLiteTx) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=7054:7088#L287">Commit</a></h3>
  618. <pre>func (tx *<a href="index.html#SQLiteTx">SQLiteTx</a>) Commit() <a href="../../../builtin/index.html#error">error</a></pre>
  619. <p>
  620. Commit transaction.
  621. </p>
  622. <h3 id="SQLiteTx.Rollback">func (*SQLiteTx) <a href="http://localhost:6060/src/github.com/mattn/go-sqlite3/sqlite3.go?s=7446:7482#L299">Rollback</a></h3>
  623. <pre>func (tx *<a href="index.html#SQLiteTx">SQLiteTx</a>) Rollback() <a href="../../../builtin/index.html#error">error</a></pre>
  624. <p>
  625. Rollback transaction.
  626. </p>
  627. <h2 id="pkg-subdirectories">Subdirectories</h2>
  628. <div class="pkg-dir">
  629. <table>
  630. <tr>
  631. <th class="pkg-name">Name</th>
  632. <th class="pkg-synopsis">Synopsis</th>
  633. </tr>
  634. <tr>
  635. <td colspan="2"><a href="../index.html">..</a></td>
  636. </tr>
  637. <tr>
  638. <td class="pkg-name" style="padding-left: 0px;">
  639. <a href="sqlite3_test/index.html">sqlite3_test</a>
  640. </td>
  641. <td class="pkg-synopsis">
  642. </td>
  643. </tr>
  644. <tr>
  645. <td class="pkg-name" style="padding-left: 0px;">
  646. <a href="tool/index.html">tool</a>
  647. </td>
  648. <td class="pkg-synopsis">
  649. </td>
  650. </tr>
  651. </table>
  652. </div>
  653. <div id="footer">
  654. Build version go1.6.<br>
  655. Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
  656. the content of this page is licensed under the
  657. Creative Commons Attribution 3.0 License,
  658. and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
  659. <a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
  660. <a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
  661. </div>
  662. </div><!-- .container -->
  663. </div><!-- #page -->
  664. <!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
  665. <script type="text/javascript" src="../../../../lib/godoc/jquery.js"></script>
  666. <script type="text/javascript" src="../../../../lib/godoc/jquery.treeview.js"></script>
  667. <script type="text/javascript" src="../../../../lib/godoc/jquery.treeview.edit.js"></script>
  668. <script type="text/javascript" src="../../../../lib/godoc/godocs.js"></script>
  669. </body>
  670. </html>