LuaSQLite3

Check-in [c85464e1bc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add docn for db:load_extension
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c85464e1bc5c5d48b34bf036c4432481678db0fd
User & Date: e 2015-01-06 03:06:59
Context
2015-01-06
04:51
Add lversion function; prepare for 0.9.3 release. check-in: f465f235ba user: e tags: trunk
03:06
Add docn for db:load_extension check-in: c85464e1bc user: e tags: trunk
2015-01-05
23:16
Add tests for load_extension. check-in: d1f2e3f61b user: e tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to doc/lsqlite3.wiki.

35
36
37
38
39
40
41

42
43
44
45
46
47
48
..
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83
84
85
86
87
88
...
369
370
371
372
373
374
375
















376
377
378
379
380
381
382
		<li><a href="#db_create_function">db:create_function</a></li>
		<li><a href="#db_errcode">db:errcode</a></li>
		<li><a href="#db_errmsg">db:errmsg</a></li>
		<li><a href="#db_exec">db:exec</a></li>
		<li><a href="#db_interrupt">db:interrupt</a></li>
		<li><a href="#db_isopen">db:isopen</a></li>
		<li><a href="#db_last_insert_rowid">db:last_insert_rowid</a></li>

		<li><a href="#db_nrows">db:nrows</a></li>
		<li><a href="#db_prepare">db:prepare</a></li>
		<li><a href="#db_progress_handler">db:progress_handler</a></li>
        <li><a href="#db_rollback_hook">db:rollback_hook</a></li>
		<li><a href="#db_rows">db:rows</a></li>
		<li><a href="#db_total_changes">db:total_changes</a></li>
        <li><a href="#db_trace">db:trace</a></li>
................................................................................
		<li><a href="#stmt_get_types">stmt:get_types</a></li>
		<li><a href="#stmt_get_unames">stmt:get_unames</a></li>
		<li><a href="#stmt_get_utypes">stmt:get_utypes</a></li>
		<li><a href="#stmt_get_uvalues">stmt:get_uvalues</a></li>
		<li><a href="#stmt_get_value">stmt:get_value</a></li>
		<li><a href="#stmt_get_values">stmt:get_values</a></li>
		<li><a href="#stmt_isopen">stmt:isopen</a></li>

		<li><a href="#stmt_nrows">stmt:nrows</a></li>
		<li><a href="#stmt_reset">stmt:reset</a></li>
		<li><a href="#stmt_rows">stmt:rows</a></li>
		<li><a href="#stmt_step">stmt:step</a></li>
        <li><a href="#stmt_urows">stmt:urows</a></li>
        <li><a href="#stmt_last_insert_rowid">stmt:last_insert_rowid</a></li>
	</ul>

	<li><a href="#methods_for_callback_contexts">Methods for callback contexts</a></li>
	<ul>

		<li><a href="#context_aggregate_count">context:aggregate_count</a></li>
		<li><a href="#context_get_aggregate_data">context:get_aggregate_data</a></li>
................................................................................
        db:exec'INSERT INTO test VALUES(3,6,16)'
        db:create_function('sum_cols',3,function(ctx,a,b,c)
          ctx:result_number(a+b+c)
        end))
        for col1,col2,col3,sum in db:urows('SELECT *,sum_cols(col1,col2,col3) FROM test') do
          util.printf('%2i+%2i+%2i=%2i\n',col1,col2,col3,sum)
        end</pre>
















<p>
</p>
<h2><a name="db_errcode">db:errcode</a></h2>
<pre>
        db:errcode()
        db:error_code()</pre>
<p>Returns the numerical result code (or extended result code) for the most







>







 







>





<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
70
71
72
73
74
75
76
77
78
79
80
81
82

83
84
85
86
87
88
89
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
		<li><a href="#db_create_function">db:create_function</a></li>
		<li><a href="#db_errcode">db:errcode</a></li>
		<li><a href="#db_errmsg">db:errmsg</a></li>
		<li><a href="#db_exec">db:exec</a></li>
		<li><a href="#db_interrupt">db:interrupt</a></li>
		<li><a href="#db_isopen">db:isopen</a></li>
		<li><a href="#db_last_insert_rowid">db:last_insert_rowid</a></li>
		<li><a href="#db_load_extension">db:load_extension</a></li>
		<li><a href="#db_nrows">db:nrows</a></li>
		<li><a href="#db_prepare">db:prepare</a></li>
		<li><a href="#db_progress_handler">db:progress_handler</a></li>
        <li><a href="#db_rollback_hook">db:rollback_hook</a></li>
		<li><a href="#db_rows">db:rows</a></li>
		<li><a href="#db_total_changes">db:total_changes</a></li>
        <li><a href="#db_trace">db:trace</a></li>
................................................................................
		<li><a href="#stmt_get_types">stmt:get_types</a></li>
		<li><a href="#stmt_get_unames">stmt:get_unames</a></li>
		<li><a href="#stmt_get_utypes">stmt:get_utypes</a></li>
		<li><a href="#stmt_get_uvalues">stmt:get_uvalues</a></li>
		<li><a href="#stmt_get_value">stmt:get_value</a></li>
		<li><a href="#stmt_get_values">stmt:get_values</a></li>
		<li><a href="#stmt_isopen">stmt:isopen</a></li>
        <li><a href="#stmt_last_insert_rowid">stmt:last_insert_rowid</a></li>
		<li><a href="#stmt_nrows">stmt:nrows</a></li>
		<li><a href="#stmt_reset">stmt:reset</a></li>
		<li><a href="#stmt_rows">stmt:rows</a></li>
		<li><a href="#stmt_step">stmt:step</a></li>
        <li><a href="#stmt_urows">stmt:urows</a></li>

	</ul>

	<li><a href="#methods_for_callback_contexts">Methods for callback contexts</a></li>
	<ul>

		<li><a href="#context_aggregate_count">context:aggregate_count</a></li>
		<li><a href="#context_get_aggregate_data">context:get_aggregate_data</a></li>
................................................................................
        db:exec'INSERT INTO test VALUES(3,6,16)'
        db:create_function('sum_cols',3,function(ctx,a,b,c)
          ctx:result_number(a+b+c)
        end))
        for col1,col2,col3,sum in db:urows('SELECT *,sum_cols(col1,col2,col3) FROM test') do
          util.printf('%2i+%2i+%2i=%2i\n',col1,col2,col3,sum)
        end</pre>
<p>
</p>
<h2><a name="db_load_extension">db:load_extension</a></h2>
<pre>
        db:load_extension([name,[entrypoint]])</pre>

<p>When a <code>name</code> is provided, loads an SQLite extension library from the 
named file into this database connection. The optional <code>entrypoint</code> is the 
library initialization function name; if not supplied, SQLite tries various default 
entrypoint names. Returns <code>true</code> when successful, or <code>false</code> and 
an error string otherwise.
</p>
<p>When called with no arguments, disables the load_extension() SQL function, which is 
enabled as a side effect of calling <code>db:load_extension</code> with a 
<code>name</code>.
</p>
<p>
</p>
<h2><a name="db_errcode">db:errcode</a></h2>
<pre>
        db:errcode()
        db:error_code()</pre>
<p>Returns the numerical result code (or extended result code) for the most