Lines Matching full:sqlite
8 #include "sqlite.h"
48 /* internal handle for SQLite database */
51 void *sqlite; /* SQLite handle */
64 int haveutf; /* true for SQLite UTF-8 support */
66 struct hfunc *funcs; /* SQLite user defined function handles */
68 struct hvm *vms; /* Compiled SQLite VMs */
81 /* internal handle for SQLite user defined function */
91 handle *h; /* SQLite database handle */
92 void *sf; /* SQLite function handle */
97 /* internal handle for SQLite VM (sqlite_compile()) */
104 void *vm; /* SQLite 2/3 VM/statement */
107 handle *h; /* SQLite database handle */
108 handle hh; /* fake SQLite database handle */
118 handle *h; /* SQLite database handle */
128 handle *h; /* SQLite database handle (source) */
307 jclass except = (*env)->FindClass(env, "SQLite/Exception");
811 if (h->sqlite) {
814 sqlite3_close((sqlite3 *) h->sqlite);
816 sqlite_close((sqlite *) h->sqlite);
820 sqlite_close((sqlite *) h->sqlite);
823 sqlite3_close((sqlite3 *) h->sqlite);
826 h->sqlite = 0;
896 if (h && h->sqlite) {
899 sqlite3_busy_timeout((sqlite3 * ) h->sqlite, ms);
901 sqlite_busy_timeout((sqlite *) h->sqlite, ms);
905 sqlite_busy_timeout((sqlite *) h->sqlite, ms);
908 sqlite3_busy_timeout((sqlite3 * ) h->sqlite, ms);
936 if (h && h->sqlite) {
959 if (h && h->sqlite) {
962 return (jlong) sqlite3_last_insert_rowid((sqlite3 *) h->sqlite);
964 return (jlong) sqlite_last_insert_rowid((sqlite *) h->sqlite);
968 return (jlong) sqlite_last_insert_rowid((sqlite *) h->sqlite);
971 return (jlong) sqlite3_last_insert_rowid((sqlite3 *) h->sqlite);
984 if (h && h->sqlite) {
987 return (jlong) sqlite3_changes((sqlite3 *) h->sqlite);
989 return (jlong) sqlite_changes((sqlite *) h->sqlite);
993 return (jlong) sqlite_changes((sqlite *) h->sqlite);
996 return (jlong) sqlite3_changes((sqlite3 *) h->sqlite);
1031 if (h && h->sqlite) {
1034 sqlite3_interrupt((sqlite3 *) h->sqlite);
1036 sqlite_interrupt((sqlite *) h->sqlite);
1040 sqlite_interrupt((sqlite *) h->sqlite);
1043 sqlite3_interrupt((sqlite3 *) h->sqlite);
1069 if (h->sqlite) {
1072 sqlite3_close((sqlite3 *) h->sqlite);
1074 sqlite_close((sqlite *) h->sqlite);
1079 sqlite_close((sqlite *) h->sqlite);
1082 sqlite3_close((sqlite3 *) h->sqlite);
1085 h->sqlite = 0;
1090 throwoom(env, "unable to get SQLite handle");
1093 h->sqlite = 0;
1155 int rc = sqlite3_open_v2(filename.result, (sqlite3 **) &h->sqlite,
1158 int rc = sqlite3_open(filename.result, (sqlite3 **) &h->sqlite);
1163 } else if (h->sqlite) {
1164 sqlite3_close((sqlite3 *) h->sqlite);
1165 h->sqlite = 0;
1168 h->sqlite = (void *) sqlite_open(filename.result,
1174 h->sqlite = (void *) sqlite_open(filename.result, (int) mode, &err);
1178 if (sqlite3_open_v2(filename.result, (sqlite3 **) &h->sqlite,
1181 if (sqlite3_open(filename.result, (sqlite3 **) &h->sqlite) != SQLITE_OK)
1184 if (h->sqlite) {
1185 sqlite3_close((sqlite3 *) h->sqlite);
1186 h->sqlite = 0;
1203 if (h->sqlite) {
1206 sqlite3_close((sqlite3 *) h->sqlite);
1209 sqlite_close((sqlite *) h->sqlite);
1213 sqlite_close((sqlite *) h->sqlite);
1216 sqlite3_close((sqlite3 *) h->sqlite);
1220 h->sqlite = 0;
1223 if (h->sqlite) {
1238 sqlite3_enable_load_extension((sqlite3 *) h->sqlite, 1);
1250 sqlite3_enable_load_extension((sqlite3 *) h->sqlite, 1);
1282 if (h && h->sqlite) {
1295 ret = sqlite_open_aux_file((sqlite *) h->sqlite,
1325 if (h && h->sqlite) {
1330 sqlite3_busy_handler((sqlite3 *) h->sqlite, busyhandler3, h);
1332 sqlite_busy_handler((sqlite *) h->sqlite, busyhandler, h);
1336 sqlite_busy_handler((sqlite *) h->sqlite, busyhandler, h);
1339 sqlite3_busy_handler((sqlite3 *) h->sqlite, busyhandler3, h);
1359 if (h->sqlite) {
1377 rc = sqlite3_exec((sqlite3 *) h->sqlite, sqlstr.result,
1381 rc = sqlite_exec((sqlite *) h->sqlite, sqlstr.result,
1387 rc = sqlite_exec((sqlite *) h->sqlite, sqlstr.result,
1392 rc = sqlite3_exec((sqlite3 *) h->sqlite, sqlstr.result,
1413 sprintf(msg, "error %d in sqlite*_exec", rc);
1438 if (h->sqlite) {
1560 rc = sqlite3_exec((sqlite3 *) h->sqlite, s, callback,
1569 rc = sqlite_exec_vprintf((sqlite *) h->sqlite,
1573 rc = sqlite_exec_printf((sqlite *) h->sqlite,
1598 rc = sqlite_exec_vprintf((sqlite *) h->sqlite, sqlstr.result,
1601 rc = sqlite_exec_printf((sqlite *) h->sqlite, sqlstr.result,
1646 rc = sqlite3_exec((sqlite3 *) h->sqlite, s, callback,
1679 sprintf(msg, "error %d in sqlite*_exec", rc);
1860 if (h && h->sqlite) {
1861 jclass cls = (*env)->FindClass(env, "SQLite/FunctionContext");
1871 throwex(env, "null SQLite.Function not allowed");
1876 throwoom(env, "unable to get SQLite.FunctionContext handle");
1899 ret = sqlite3_create_function((sqlite3 *) h->sqlite,
1909 ret = sqlite_create_aggregate((sqlite *) h->sqlite,
1914 ret = sqlite_create_function((sqlite *) h->sqlite,
1923 ret = sqlite_create_aggregate((sqlite *) h->sqlite, namestr.result,
1927 ret = sqlite_create_function((sqlite *) h->sqlite, namestr.result,
1933 ret = sqlite3_create_function((sqlite3 *) h->sqlite,
1971 if (h && h->sqlite) {
1990 ret = sqlite_function_type(h->sqlite, namestr.result, (int) type);
2261 if (h && h->sqlite) {
2268 sqlite3_errmsg((sqlite3 *) h->sqlite));
2367 if (h && h->sqlite) {
2374 sqlite3_set_authorizer((sqlite3 *) h->sqlite,
2377 sqlite_set_authorizer((sqlite *) h->sqlite,
2382 sqlite_set_authorizer((sqlite *) h->sqlite, h->ai ? doauth : 0, h);
2385 sqlite3_set_authorizer((sqlite3 *) h->sqlite, h->ai ? doauth : 0, h);
2432 if (h && h->sqlite) {
2437 sqlite3_trace((sqlite3 *) h->sqlite, h->tr ? dotrace : 0, h);
2440 sqlite_trace((sqlite *) h->sqlite, h->tr ? dotrace : 0, h);
2446 sqlite_trace((sqlite *) h->sqlite, h->tr ? dotrace : 0, h);
2450 sqlite3_trace((sqlite3 *) h->sqlite, h->tr ? dotrace : 0, h);
2918 if (v && v->h && v->h->sqlite) {
2926 ret = sqlite3_prepare_v2((sqlite3 *) v->h->sqlite, v->tail, -1,
2929 ret = sqlite3_prepare((sqlite3 *) v->h->sqlite, v->tail, -1,
2937 err = (char *) sqlite3_errmsg((sqlite3 *) v->h->sqlite);
2940 ret = sqlite_compile((sqlite *) v->h->sqlite, v->tail,
2952 ret = sqlite_compile((sqlite *) v->h->sqlite, v->tail,
2964 ret = sqlite3_prepare_v2((sqlite3 *) v->h->sqlite,
2967 ret = sqlite3_prepare((sqlite3 *) v->h->sqlite,
2975 err = (char *) sqlite3_errmsg((sqlite3 *) v->h->sqlite);
3051 ret = sqlite3_prepare_v2((sqlite3 *) h->sqlite, tr.result, -1,
3054 ret = sqlite3_prepare((sqlite3 *) h->sqlite, tr.result, -1,
3062 err = (char *) sqlite3_errmsg((sqlite3 *) h->sqlite);
3065 ret = sqlite_compile((sqlite *) h->sqlite, tr.result, &tail,
3076 ret = sqlite_compile((sqlite *) h->sqlite, tr.result, &tail,
3088 ret = sqlite3_prepare_v2((sqlite3 *) h->sqlite, tr.result, -1,
3091 ret = sqlite3_prepare((sqlite3 *) h->sqlite, tr.result, -1,
3099 err = (char *) sqlite3_errmsg((sqlite3 *) h->sqlite);
3140 throwoom(env, "unable to get SQLite handle");
3152 v->hh.sqlite = 0;
3190 if (!h || !h->sqlite) {
3305 rc = sqlite3_prepare_v2((sqlite3 *) h->sqlite, s, -1,
3308 rc = sqlite3_prepare((sqlite3 *) h->sqlite, s, -1,
3345 throwoom(env, "unable to get SQLite handle");
3358 v->hh.sqlite = 0;
3402 if (h && h->sqlite) {
3410 sqlite3_progress_handler((sqlite3 *) h->sqlite,
3413 sqlite3_progress_handler((sqlite3 *) h->sqlite,
3419 sqlite_progress_handler((sqlite *) h->sqlite,
3422 sqlite_progress_handler((sqlite *) h->sqlite,
3430 sqlite_progress_handler((sqlite *) h->sqlite,
3433 sqlite_progress_handler((sqlite *) h->sqlite,
3440 sqlite3_progress_handler((sqlite3 *) h->sqlite,
3443 sqlite3_progress_handler((sqlite3 *) h->sqlite,
3490 if (v && v->h && v->h->sqlite) {
3496 ret = sqlite3_prepare16_v2((sqlite3 *) v->h->sqlite,
3500 ret = sqlite3_prepare16((sqlite3 *) v->h->sqlite,
3511 const char *err = sqlite3_errmsg(v->h->sqlite);
3572 ret = sqlite3_prepare16_v2((sqlite3 *) h->sqlite, sql16, len16,
3575 ret = sqlite3_prepare16((sqlite3 *) h->sqlite, sql16, len16,
3585 const char *err = sqlite3_errmsg(h->sqlite);
3604 throwoom(env, "unable to get SQLite handle");
3619 v->hh.sqlite = 0;
3650 const char *err = sqlite3_errmsg(v->h->sqlite);
3676 const char *err = sqlite3_errmsg(v->h->sqlite);
4370 throwex(env, "not a SQLite 3 database");
4374 if (h && h->sqlite) {
4396 ret = sqlite3_blob_open(h->sqlite,
4403 const char *err = sqlite3_errmsg(h->sqlite);
4412 throwoom(env, "unable to get SQLite blob handle");
4548 if (h && h->sqlite) {
4557 sqlite3_key((sqlite3 *) h->sqlite, data, len);
4593 if (h && h->sqlite) {
4602 sqlite3_rekey((sqlite3 *) h->sqlite, data, len);
4661 throwex(env, "not a SQLite 3 database");
4665 if (!hsrc->sqlite) {
4669 if (!hdest->sqlite) {
4686 bkup = sqlite3_backup_init((sqlite3 *) hdest->sqlite, dbnd.result,
4687 (sqlite3 *) hsrc->sqlite, dbns.result);
4691 const char *err = sqlite3_errmsg((sqlite3 *) hdest->sqlite);
4693 seterr(env, src, sqlite3_errcode((sqlite3 *) hdest->sqlite));
4700 throwoom(env, "unable to get SQLite backup handle");
4743 err = (char *) sqlite3_errmsg((sqlite3 *) bk->h->sqlite);
4871 if (h && h->sqlite) {
4876 sqlite3_profile((sqlite3 *) h->sqlite, h->pr ? doprofile : 0, h);
4880 sqlite3_profile((sqlite3 *) h->sqlite, h->pr ? doprofile : 0, h);
4917 if (h && h->sqlite) {
4920 ret = sqlite3_db_status((sqlite3 *) h->sqlite, op, &data[0],
4925 ret = sqlite3_db_status((sqlite3 *) h->sqlite, op, &data[0],