mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Hopefully the last major API rename in the JNI bits: rename all lower_camel_case classes which do not have direct counterparts in the C API to UpperCamelCase, as that's more idiomatic. Java types which reflect C-style types are unaffected.
FossilOrigin-Name: 8ca528006533ac152e9b322e421cf5d339414c77332d9836a9ff429b793d0d2d
This commit is contained in:
@ -1847,7 +1847,7 @@ S3JniApi(sqlite3_aggregate_context(),jlong,1aggregate_1context)(
|
||||
? (int)sizeof(void*)
|
||||
: 0))
|
||||
: 0;
|
||||
return (jlong)p / sizeof(void*);
|
||||
return (jlong)p;
|
||||
}
|
||||
|
||||
|
||||
|
@ -782,7 +782,7 @@ JNIEXPORT jlong JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1aggregate_1conte
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_auto_extension
|
||||
* Signature: (Lorg/sqlite/jni/auto_extension_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/AutoExtensionCallback;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1auto_1extension
|
||||
(JNIEnv *, jclass, jobject);
|
||||
@ -878,7 +878,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1bind_1zeroblob64
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_busy_handler
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/busy_handler_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/BusyHandlerCallback;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1busy_1handler
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
@ -894,7 +894,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1busy_1timeout
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_cancel_auto_extension
|
||||
* Signature: (Lorg/sqlite/jni/auto_extension_callback;)Z
|
||||
* Signature: (Lorg/sqlite/jni/AutoExtensionCallback;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1cancel_1auto_1extension
|
||||
(JNIEnv *, jclass, jobject);
|
||||
@ -1062,7 +1062,7 @@ JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1column_1value
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_collation_needed
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/collation_needed_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/CollationNeededCallback;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1collation_1needed
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
@ -1078,7 +1078,7 @@ JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1context_1db_1h
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_commit_hook
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/commit_hook_callback;)Lorg/sqlite/jni/commit_hook_callback;
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/CommitHookCallback;)Lorg/sqlite/jni/CommitHookCallback;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1commit_1hook
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
@ -1110,15 +1110,15 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1config__I
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_config
|
||||
* Signature: (Lorg/sqlite/jni/config_sqllog_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/ConfigSqllogCallback;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1config__Lorg_sqlite_jni_config_1sqllog_1callback_2
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1config__Lorg_sqlite_jni_ConfigSqllogCallback_2
|
||||
(JNIEnv *, jclass, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_create_collation
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Ljava/lang/String;ILorg/sqlite/jni/collation_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Ljava/lang/String;ILorg/sqlite/jni/Collation;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1create_1collation
|
||||
(JNIEnv *, jclass, jobject, jstring, jint, jobject);
|
||||
@ -1350,7 +1350,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1preupdate_1depth
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_preupdate_hook
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/preupdate_hook_callback;)Lorg/sqlite/jni/preupdate_hook_callback;
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/PreupdateHookCallback;)Lorg/sqlite/jni/PreupdateHookCallback;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1preupdate_1hook
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
@ -1374,7 +1374,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1preupdate_1old
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_progress_handler
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/progress_handler_callback;)V
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/ProgressHandlerCallback;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1progress_1handler
|
||||
(JNIEnv *, jclass, jobject, jint, jobject);
|
||||
@ -1550,7 +1550,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1status64
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_rollback_hook
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/rollback_hook_callback;)Lorg/sqlite/jni/rollback_hook_callback;
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/RollbackHookCallback;)Lorg/sqlite/jni/RollbackHookCallback;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1rollback_1hook
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
@ -1558,7 +1558,7 @@ JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1rollback_1hook
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_set_authorizer
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/authorizer_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/AuthorizerCallback;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1set_1authorizer
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
@ -1646,7 +1646,7 @@ JNIEXPORT jlong JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1total_1changes64
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_trace_v2
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/trace_v2_callback;)I
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/TraceV2Callback;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1trace_1v2
|
||||
(JNIEnv *, jclass, jobject, jint, jobject);
|
||||
@ -1654,7 +1654,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1trace_1v2
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_update_hook
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/update_hook_callback;)Lorg/sqlite/jni/update_hook_callback;
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/UpdateHookCallback;)Lorg/sqlite/jni/UpdateHookCallback;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1update_1hook
|
||||
(JNIEnv *, jclass, jobject, jobject);
|
||||
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_set_authorizer().
|
||||
*/
|
||||
public interface authorizer_callback extends sqlite3_callback_proxy {
|
||||
public interface AuthorizerCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Must function as described for the C-level
|
||||
sqlite3_set_authorizer() callback.
|
@ -17,7 +17,7 @@ package org.sqlite.jni;
|
||||
A callback for use with the sqlite3_auto_extension() family of
|
||||
APIs.
|
||||
*/
|
||||
public interface auto_extension_callback extends sqlite3_callback_proxy {
|
||||
public interface AutoExtensionCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Must function as described for a C-level
|
||||
sqlite3_auto_extension() callback, with the caveat that the
|
@ -17,8 +17,8 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_busy_handler()
|
||||
*/
|
||||
public abstract class busy_handler_callback
|
||||
implements sqlite3_callback_proxy, xDestroy_callback {
|
||||
public abstract class BusyHandlerCallback
|
||||
implements SQLite3CallbackProxy, XDestroyCallback {
|
||||
/**
|
||||
Must function as documented for the C-level
|
||||
sqlite3_busy_handler() callback argument, minus the (void*)
|
@ -16,8 +16,8 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_create_collation()
|
||||
*/
|
||||
public abstract class collation_callback
|
||||
implements sqlite3_callback_proxy, xDestroy_callback {
|
||||
public abstract class Collation
|
||||
implements SQLite3CallbackProxy, XDestroyCallback {
|
||||
/**
|
||||
Must compare the given byte arrays using memcmp() semantics.
|
||||
*/
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_collation_needed().
|
||||
*/
|
||||
public interface collation_needed_callback extends sqlite3_callback_proxy {
|
||||
public interface CollationNeededCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Has the same semantics as the C-level sqlite3_create_collation()
|
||||
callback.
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_commit_hook()
|
||||
*/
|
||||
public interface commit_hook_callback extends sqlite3_callback_proxy {
|
||||
public interface CommitHookCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Works as documented for the C-level sqlite3_commit_hook()
|
||||
callback. Must not throw.
|
@ -16,10 +16,10 @@ package org.sqlite.jni;
|
||||
/**
|
||||
A callback for use with sqlite3_config().
|
||||
*/
|
||||
public interface config_sqllog_callback {
|
||||
public interface ConfigSqllogCallback {
|
||||
/**
|
||||
Must function as described for sqlite3_config(SQLITE_CONFIG_SQLLOG)
|
||||
callback, with the slight signature change.
|
||||
Must function as described for a C-level callback for
|
||||
{@link SQLite3Jni#sqlite3_config(ConfigSqllogCallback)}, with the slight signature change.
|
||||
*/
|
||||
void call(sqlite3 db, String msg, int msgType );
|
||||
}
|
@ -2,9 +2,11 @@ package org.sqlite.jni;
|
||||
|
||||
/**
|
||||
This annotation is for flagging parameters which may not legally be
|
||||
null. Note that the C-style API does not throw any
|
||||
NullPointerExceptions on its own because it has a no-throw policy
|
||||
in order to retain its C-style semantics.
|
||||
null. Note that the C-style API does not throw any exceptions on
|
||||
its own because it has a no-throw policy in order to retain its
|
||||
C-style semantics, but it may trigger NullPointerExceptions (or
|
||||
similar) if passed a null for a parameter flagged with this
|
||||
annotation.
|
||||
|
||||
<p>This annotation is informational only. No policy is in place to
|
||||
programmatically ensure that NotNull is conformed to in client
|
||||
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_preupdate_hook().
|
||||
*/
|
||||
public interface preupdate_hook_callback extends sqlite3_callback_proxy {
|
||||
public interface PreupdateHookCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Must function as described for the C-level sqlite3_preupdate_hook()
|
||||
callback. Must not throw.
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_progress_handler()
|
||||
*/
|
||||
public interface progress_handler_callback extends sqlite3_callback_proxy {
|
||||
public interface ProgressHandlerCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Works as documented for the C-level sqlite3_progress_handler() callback.
|
||||
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_rollback_hook()
|
||||
*/
|
||||
public interface rollback_hook_callback extends sqlite3_callback_proxy {
|
||||
public interface RollbackHookCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Works as documented for the C-level sqlite3_rollback_hook()
|
||||
callback. Must not throw.
|
@ -38,6 +38,9 @@ public abstract class SQLFunction {
|
||||
managing their accumulator state across calls to the UDF's
|
||||
callbacks.
|
||||
|
||||
<p>T must be of a type which can be legally stored as a value in
|
||||
java.util.HashMap<KeyType,T>.
|
||||
|
||||
<p>If a given aggregate or window function is called multiple times
|
||||
in a single SQL statement, e.g. SELECT MYFUNC(A), MYFUNC(B)...,
|
||||
then the clients need some way of knowing which call is which so
|
||||
@ -55,9 +58,6 @@ public abstract class SQLFunction {
|
||||
Client UDFs are free to perform such mappings using custom
|
||||
approaches. The provided Aggregate<T> and Window<T> classes
|
||||
use this.
|
||||
|
||||
<p>T must be of a type which can be legally stored as a value in
|
||||
java.util.HashMap<KeyType,T>.
|
||||
*/
|
||||
public static final class PerContextState<T> {
|
||||
private final java.util.Map<Long,ValueHolder<T>> map
|
||||
|
@ -20,15 +20,15 @@ package org.sqlite.jni;
|
||||
|
||||
<p>Callbacks of this style follow a common naming convention:
|
||||
|
||||
<p>1) They almost all have the same class or interface name as the
|
||||
C function they are proxying a callback for, minus the sqlite3_
|
||||
prefix, plus a _callback suffix. e.g. sqlite3_busy_handler()'s
|
||||
callback is named busy_handler_callback. Exceptions are made where
|
||||
that would potentially be ambiguous, e.g. config_sqllog_callback
|
||||
instead of config_callback because the sqlite3_config() interface
|
||||
may need to support more callback types in the future.
|
||||
<p>1) They use the UpperCamelCase form of the C function they're
|
||||
proxying for, minus the sqlite3_ prefix, plus a Callback
|
||||
suffix. e.g. sqlite3_busy_handler()'s callback is named
|
||||
BusyHandlerCallback. Exceptions are made where that would
|
||||
potentially be ambiguous, e.g. ConfigSqllogCallback instead of
|
||||
config_callback because the sqlite3_config() interface may need to
|
||||
support more callback types in the future.
|
||||
|
||||
<p>2) They all have a call() method but its signature is
|
||||
callback-specific.
|
||||
*/
|
||||
public interface sqlite3_callback_proxy {}
|
||||
public interface SQLite3CallbackProxy {}
|
@ -155,7 +155,7 @@ public final class SQLite3Jni {
|
||||
|
||||
<p>See the AutoExtension class docs for more information.
|
||||
*/
|
||||
public static native int sqlite3_auto_extension(@NotNull auto_extension_callback callback);
|
||||
public static native int sqlite3_auto_extension(@NotNull AutoExtensionCallback callback);
|
||||
|
||||
/**
|
||||
Results are undefined if data is not null and n<0 || n>=data.length.
|
||||
@ -286,12 +286,12 @@ public final class SQLite3Jni {
|
||||
);
|
||||
|
||||
/**
|
||||
As for the C-level function of the same name, with a busy_handler_callback
|
||||
As for the C-level function of the same name, with a BusyHandlerCallback
|
||||
instance in place of a callback function. Pass it a null handler
|
||||
to clear the busy handler.
|
||||
*/
|
||||
public static native int sqlite3_busy_handler(
|
||||
@NotNull sqlite3 db, @Nullable busy_handler_callback handler
|
||||
@NotNull sqlite3 db, @Nullable BusyHandlerCallback handler
|
||||
);
|
||||
|
||||
public static native int sqlite3_busy_timeout(
|
||||
@ -299,7 +299,7 @@ public final class SQLite3Jni {
|
||||
);
|
||||
|
||||
public static native boolean sqlite3_cancel_auto_extension(
|
||||
@NotNull auto_extension_callback ax
|
||||
@NotNull AutoExtensionCallback ax
|
||||
);
|
||||
|
||||
public static native int sqlite3_changes(
|
||||
@ -465,7 +465,7 @@ public final class SQLite3Jni {
|
||||
Java's string type is compatible with that interface.
|
||||
*/
|
||||
public static native int sqlite3_collation_needed(
|
||||
@NotNull sqlite3 db, @Nullable collation_needed_callback callback
|
||||
@NotNull sqlite3 db, @Nullable CollationNeededCallback callback
|
||||
);
|
||||
|
||||
/**
|
||||
@ -476,8 +476,8 @@ public final class SQLite3Jni {
|
||||
@NotNull sqlite3_context cx
|
||||
);
|
||||
|
||||
public static native commit_hook_callback sqlite3_commit_hook(
|
||||
@NotNull sqlite3 db, @Nullable commit_hook_callback hook
|
||||
public static native CommitHookCallback sqlite3_commit_hook(
|
||||
@NotNull sqlite3 db, @Nullable CommitHookCallback hook
|
||||
);
|
||||
|
||||
public static native String sqlite3_compileoption_get(
|
||||
@ -488,34 +488,34 @@ public final class SQLite3Jni {
|
||||
@NotNull String optName
|
||||
);
|
||||
|
||||
/*
|
||||
** Works like in the C API with the exception that it only supports
|
||||
** the following subset of configution flags:
|
||||
**
|
||||
** - SQLITE_CONFIG_SINGLETHREAD
|
||||
** - SQLITE_CONFIG_MULTITHREAD
|
||||
** - SQLITE_CONFIG_SERIALIZED
|
||||
**
|
||||
** Others may be added in the future. It returns SQLITE_MISUSE if
|
||||
** given an argument it does not handle.
|
||||
/**
|
||||
<p>Works like in the C API with the exception that it only supports
|
||||
the following subset of configution flags:
|
||||
|
||||
<p>SQLITE_CONFIG_SINGLETHREAD
|
||||
SQLITE_CONFIG_MULTITHREAD
|
||||
SQLITE_CONFIG_SERIALIZED
|
||||
|
||||
<p>Others may be added in the future. It returns SQLITE_MISUSE if
|
||||
given an argument it does not handle.
|
||||
*/
|
||||
public static native int sqlite3_config(int op);
|
||||
|
||||
/*
|
||||
** If the native library was built with SQLITE_ENABLE_SQLLOG defined
|
||||
** then this acts as a proxy for C's
|
||||
** sqlite3_config(SQLITE_ENABLE_SQLLOG,...). This sets or clears the
|
||||
** logger. If installation of a logger fails, any previous logger is
|
||||
** retained.
|
||||
**
|
||||
** If not built with SQLITE_ENABLE_SQLLOG defined, this returns
|
||||
** SQLITE_MISUSE.
|
||||
/**
|
||||
If the native library was built with SQLITE_ENABLE_SQLLOG defined
|
||||
then this acts as a proxy for C's
|
||||
sqlite3_config(SQLITE_ENABLE_SQLLOG,...). This sets or clears the
|
||||
logger. If installation of a logger fails, any previous logger is
|
||||
retained.
|
||||
|
||||
If not built with SQLITE_ENABLE_SQLLOG defined, this returns
|
||||
SQLITE_MISUSE.
|
||||
*/
|
||||
public static native int sqlite3_config( @Nullable config_sqllog_callback logger );
|
||||
public static native int sqlite3_config( @Nullable ConfigSqllogCallback logger );
|
||||
|
||||
public static native int sqlite3_create_collation(
|
||||
@NotNull sqlite3 db, @NotNull String name, int eTextRep,
|
||||
@NotNull collation_callback col
|
||||
@NotNull Collation col
|
||||
);
|
||||
|
||||
/**
|
||||
@ -834,8 +834,8 @@ public final class SQLite3Jni {
|
||||
acts as a proxy for C's sqlite3_preupdate_hook(), else it returns null
|
||||
with no side effects.
|
||||
*/
|
||||
public static native preupdate_hook_callback sqlite3_preupdate_hook(
|
||||
@NotNull sqlite3 db, @Nullable preupdate_hook_callback hook
|
||||
public static native PreupdateHookCallback sqlite3_preupdate_hook(
|
||||
@NotNull sqlite3 db, @Nullable PreupdateHookCallback hook
|
||||
);
|
||||
|
||||
/**
|
||||
@ -875,7 +875,7 @@ public final class SQLite3Jni {
|
||||
}
|
||||
|
||||
public static native void sqlite3_progress_handler(
|
||||
@NotNull sqlite3 db, int n, @Nullable progress_handler_callback h
|
||||
@NotNull sqlite3 db, int n, @Nullable ProgressHandlerCallback h
|
||||
);
|
||||
|
||||
public static native int sqlite3_reset(@NotNull sqlite3_stmt stmt);
|
||||
@ -1163,13 +1163,13 @@ public final class SQLite3Jni {
|
||||
}
|
||||
}
|
||||
|
||||
public static native rollback_hook_callback sqlite3_rollback_hook(
|
||||
@NotNull sqlite3 db, @Nullable rollback_hook_callback hook
|
||||
public static native RollbackHookCallback sqlite3_rollback_hook(
|
||||
@NotNull sqlite3 db, @Nullable RollbackHookCallback hook
|
||||
);
|
||||
|
||||
//! Sets or unsets (if auth is null) the current authorizer.
|
||||
public static native int sqlite3_set_authorizer(
|
||||
@NotNull sqlite3 db, @Nullable authorizer_callback auth
|
||||
@NotNull sqlite3 db, @Nullable AuthorizerCallback auth
|
||||
);
|
||||
|
||||
public static native void sqlite3_set_last_insert_rowid(
|
||||
@ -1236,11 +1236,11 @@ public final class SQLite3Jni {
|
||||
cannot be processed propertly (i.e. an internal error).
|
||||
*/
|
||||
public static native int sqlite3_trace_v2(
|
||||
@NotNull sqlite3 db, int traceMask, @Nullable trace_v2_callback tracer
|
||||
@NotNull sqlite3 db, int traceMask, @Nullable TraceV2Callback tracer
|
||||
);
|
||||
|
||||
public static native update_hook_callback sqlite3_update_hook(
|
||||
sqlite3 db, update_hook_callback hook
|
||||
public static native UpdateHookCallback sqlite3_update_hook(
|
||||
sqlite3 db, UpdateHookCallback hook
|
||||
);
|
||||
|
||||
public static native byte[] sqlite3_value_blob(@NotNull sqlite3_value v);
|
||||
|
@ -489,7 +489,7 @@ public class Tester1 implements Runnable {
|
||||
final sqlite3 db = createNewDb();
|
||||
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
|
||||
final ValueHolder<Boolean> xDestroyCalled = new ValueHolder<>(false);
|
||||
final collation_callback myCollation = new collation_callback() {
|
||||
final Collation myCollation = new Collation() {
|
||||
private String myState =
|
||||
"this is local state. There is much like it, but this is mine.";
|
||||
@Override
|
||||
@ -513,7 +513,7 @@ public class Tester1 implements Runnable {
|
||||
xDestroyCalled.value = true;
|
||||
}
|
||||
};
|
||||
final collation_needed_callback collLoader = new collation_needed_callback(){
|
||||
final CollationNeededCallback collLoader = new CollationNeededCallback(){
|
||||
@Override
|
||||
public int call(sqlite3 dbArg, int eTextRep, String collationName){
|
||||
affirm(dbArg == db/* as opposed to a temporary object*/);
|
||||
@ -881,7 +881,7 @@ public class Tester1 implements Runnable {
|
||||
int rc = sqlite3_trace_v2(
|
||||
db, SQLITE_TRACE_STMT | SQLITE_TRACE_PROFILE
|
||||
| SQLITE_TRACE_ROW | SQLITE_TRACE_CLOSE,
|
||||
new trace_v2_callback(){
|
||||
new TraceV2Callback(){
|
||||
@Override public int call(int traceFlag, Object pNative, Object x){
|
||||
++counter.value;
|
||||
//outln("TRACE "+traceFlag+" pNative = "+pNative.getClass().getName());
|
||||
@ -942,7 +942,7 @@ public class Tester1 implements Runnable {
|
||||
|
||||
final ValueHolder<Boolean> xDestroyed = new ValueHolder<>(false);
|
||||
final ValueHolder<Integer> xBusyCalled = new ValueHolder<>(0);
|
||||
busy_handler_callback handler = new busy_handler_callback(){
|
||||
BusyHandlerCallback handler = new BusyHandlerCallback(){
|
||||
@Override public int call(int n){
|
||||
//outln("busy handler #"+n);
|
||||
return n > 2 ? 0 : ++xBusyCalled.value;
|
||||
@ -976,7 +976,7 @@ public class Tester1 implements Runnable {
|
||||
private void testProgress(){
|
||||
final sqlite3 db = createNewDb();
|
||||
final ValueHolder<Integer> counter = new ValueHolder<>(0);
|
||||
sqlite3_progress_handler(db, 1, new progress_handler_callback(){
|
||||
sqlite3_progress_handler(db, 1, new ProgressHandlerCallback(){
|
||||
@Override public int call(){
|
||||
++counter.value;
|
||||
return 0;
|
||||
@ -995,13 +995,13 @@ public class Tester1 implements Runnable {
|
||||
final sqlite3 db = createNewDb();
|
||||
final ValueHolder<Integer> counter = new ValueHolder<>(0);
|
||||
final ValueHolder<Integer> hookResult = new ValueHolder<>(0);
|
||||
final commit_hook_callback theHook = new commit_hook_callback(){
|
||||
final CommitHookCallback theHook = new CommitHookCallback(){
|
||||
@Override public int call(){
|
||||
++counter.value;
|
||||
return hookResult.value;
|
||||
}
|
||||
};
|
||||
commit_hook_callback oldHook = sqlite3_commit_hook(db, theHook);
|
||||
CommitHookCallback oldHook = sqlite3_commit_hook(db, theHook);
|
||||
affirm( null == oldHook );
|
||||
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
|
||||
affirm( 2 == counter.value );
|
||||
@ -1022,7 +1022,7 @@ public class Tester1 implements Runnable {
|
||||
execSql(db, "BEGIN; update t set a='g' where a='f'; COMMIT;");
|
||||
affirm( 4 == counter.value );
|
||||
|
||||
final commit_hook_callback newHook = new commit_hook_callback(){
|
||||
final CommitHookCallback newHook = new CommitHookCallback(){
|
||||
@Override public int call(){return 0;}
|
||||
};
|
||||
oldHook = sqlite3_commit_hook(db, newHook);
|
||||
@ -1044,7 +1044,7 @@ public class Tester1 implements Runnable {
|
||||
final sqlite3 db = createNewDb();
|
||||
final ValueHolder<Integer> counter = new ValueHolder<>(0);
|
||||
final ValueHolder<Integer> expectedOp = new ValueHolder<>(0);
|
||||
final update_hook_callback theHook = new update_hook_callback(){
|
||||
final UpdateHookCallback theHook = new UpdateHookCallback(){
|
||||
@Override
|
||||
public void call(int opId, String dbName, String tableName, long rowId){
|
||||
++counter.value;
|
||||
@ -1053,7 +1053,7 @@ public class Tester1 implements Runnable {
|
||||
}
|
||||
}
|
||||
};
|
||||
update_hook_callback oldHook = sqlite3_update_hook(db, theHook);
|
||||
UpdateHookCallback oldHook = sqlite3_update_hook(db, theHook);
|
||||
affirm( null == oldHook );
|
||||
expectedOp.value = SQLITE_INSERT;
|
||||
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
|
||||
@ -1073,7 +1073,7 @@ public class Tester1 implements Runnable {
|
||||
oldHook = sqlite3_update_hook(db, null);
|
||||
affirm( null == oldHook );
|
||||
|
||||
final update_hook_callback newHook = new update_hook_callback(){
|
||||
final UpdateHookCallback newHook = new UpdateHookCallback(){
|
||||
@Override public void call(int opId, String dbName, String tableName, long rowId){
|
||||
}
|
||||
};
|
||||
@ -1101,7 +1101,7 @@ public class Tester1 implements Runnable {
|
||||
final sqlite3 db = createNewDb();
|
||||
final ValueHolder<Integer> counter = new ValueHolder<>(0);
|
||||
final ValueHolder<Integer> expectedOp = new ValueHolder<>(0);
|
||||
final preupdate_hook_callback theHook = new preupdate_hook_callback(){
|
||||
final PreupdateHookCallback theHook = new PreupdateHookCallback(){
|
||||
@Override
|
||||
public void call(sqlite3 db, int opId, String dbName, String dbTable,
|
||||
long iKey1, long iKey2 ){
|
||||
@ -1126,7 +1126,7 @@ public class Tester1 implements Runnable {
|
||||
}
|
||||
}
|
||||
};
|
||||
preupdate_hook_callback oldHook = sqlite3_preupdate_hook(db, theHook);
|
||||
PreupdateHookCallback oldHook = sqlite3_preupdate_hook(db, theHook);
|
||||
affirm( null == oldHook );
|
||||
expectedOp.value = SQLITE_INSERT;
|
||||
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
|
||||
@ -1146,7 +1146,7 @@ public class Tester1 implements Runnable {
|
||||
oldHook = sqlite3_preupdate_hook(db, null);
|
||||
affirm( null == oldHook );
|
||||
|
||||
final preupdate_hook_callback newHook = new preupdate_hook_callback(){
|
||||
final PreupdateHookCallback newHook = new PreupdateHookCallback(){
|
||||
@Override
|
||||
public void call(sqlite3 db, int opId, String dbName,
|
||||
String tableName, long iKey1, long iKey2){
|
||||
@ -1168,19 +1168,19 @@ public class Tester1 implements Runnable {
|
||||
private void testRollbackHook(){
|
||||
final sqlite3 db = createNewDb();
|
||||
final ValueHolder<Integer> counter = new ValueHolder<>(0);
|
||||
final rollback_hook_callback theHook = new rollback_hook_callback(){
|
||||
final RollbackHookCallback theHook = new RollbackHookCallback(){
|
||||
@Override public void call(){
|
||||
++counter.value;
|
||||
}
|
||||
};
|
||||
rollback_hook_callback oldHook = sqlite3_rollback_hook(db, theHook);
|
||||
RollbackHookCallback oldHook = sqlite3_rollback_hook(db, theHook);
|
||||
affirm( null == oldHook );
|
||||
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
|
||||
affirm( 0 == counter.value );
|
||||
execSql(db, false, "BEGIN; SELECT 1; SELECT 2; ROLLBACK;");
|
||||
affirm( 1 == counter.value /* contra to commit hook, is invoked if no changes are made */ );
|
||||
|
||||
final rollback_hook_callback newHook = new rollback_hook_callback(){
|
||||
final RollbackHookCallback newHook = new RollbackHookCallback(){
|
||||
@Override public void call(){return;}
|
||||
};
|
||||
oldHook = sqlite3_rollback_hook(db, newHook);
|
||||
@ -1237,7 +1237,7 @@ public class Tester1 implements Runnable {
|
||||
final sqlite3 db = createNewDb();
|
||||
final ValueHolder<Integer> counter = new ValueHolder<>(0);
|
||||
final ValueHolder<Integer> authRc = new ValueHolder<>(0);
|
||||
final authorizer_callback auth = new authorizer_callback(){
|
||||
final AuthorizerCallback auth = new AuthorizerCallback(){
|
||||
public int call(int op, String s0, String s1, String s2, String s3){
|
||||
++counter.value;
|
||||
//outln("xAuth(): "+s0+" "+s1+" "+s2+" "+s3);
|
||||
@ -1260,7 +1260,7 @@ public class Tester1 implements Runnable {
|
||||
private synchronized void testAutoExtension(){
|
||||
final ValueHolder<Integer> val = new ValueHolder<>(0);
|
||||
final ValueHolder<String> toss = new ValueHolder<>(null);
|
||||
final auto_extension_callback ax = new auto_extension_callback(){
|
||||
final AutoExtensionCallback ax = new AutoExtensionCallback(){
|
||||
@Override public synchronized int call(sqlite3 db){
|
||||
++val.value;
|
||||
if( null!=toss.value ){
|
||||
@ -1311,7 +1311,7 @@ public class Tester1 implements Runnable {
|
||||
toss.value = null;
|
||||
|
||||
val.value = 0;
|
||||
final auto_extension_callback ax2 = new auto_extension_callback(){
|
||||
final AutoExtensionCallback ax2 = new AutoExtensionCallback(){
|
||||
@Override public synchronized int call(sqlite3 db){
|
||||
++val.value;
|
||||
return 0;
|
||||
@ -1507,7 +1507,7 @@ public class Tester1 implements Runnable {
|
||||
|
||||
if( sqlLog ){
|
||||
if( sqlite3_compileoption_used("ENABLE_SQLLOG") ){
|
||||
int rc = sqlite3_config( new config_sqllog_callback() {
|
||||
int rc = sqlite3_config( new ConfigSqllogCallback() {
|
||||
@Override public void call(sqlite3 db, String msg, int op){
|
||||
switch(op){
|
||||
case 0: outln("Opening db: ",db); break;
|
||||
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback proxy for use with sqlite3_trace_v2().
|
||||
*/
|
||||
public interface trace_v2_callback extends sqlite3_callback_proxy {
|
||||
public interface TraceV2Callback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Called by sqlite3 for various tracing operations, as per
|
||||
sqlite3_trace_v2(). Note that this interface elides the 2nd
|
@ -16,7 +16,7 @@ package org.sqlite.jni;
|
||||
/**
|
||||
Callback for use with sqlite3_update_hook().
|
||||
*/
|
||||
public interface update_hook_callback extends sqlite3_callback_proxy {
|
||||
public interface UpdateHookCallback extends SQLite3CallbackProxy {
|
||||
/**
|
||||
Must function as described for the C-level sqlite3_update_hook()
|
||||
callback. Must not throw.
|
@ -19,7 +19,7 @@ package org.sqlite.jni;
|
||||
the symbol name xDestroy() for this purpose in the C API
|
||||
documentation.
|
||||
*/
|
||||
public interface xDestroy_callback {
|
||||
public interface XDestroyCallback {
|
||||
/**
|
||||
Must perform any cleanup required by this object. Must not
|
||||
throw.
|
@ -25,12 +25,15 @@ public final class sqlite3_context extends NativePointerHolder<sqlite3_context>
|
||||
sqlite3_aggregate_context(), with a slightly different interface
|
||||
to account for cross-language differences. It serves the same
|
||||
purposes in a slightly different way: it provides a key which is
|
||||
stable across invocations of "matching sets" of a UDF's callbacks,
|
||||
such that all calls into those callbacks can determine which "set"
|
||||
of those calls they belong to.
|
||||
stable across invocations of a UDF's callbacks, such that all
|
||||
calls into those callbacks can determine which "set" of those
|
||||
calls they belong to.
|
||||
|
||||
<p>Note that use of this method is not a requirement for proper use
|
||||
of this class. sqlite3_aggregate_context() can also be used.
|
||||
|
||||
<p>If the argument is true and the aggregate context has not yet
|
||||
been set up, it will be initialized fetched on demand, else it
|
||||
been set up, it will be initialized and fetched on demand, else it
|
||||
won't. The intent is that xStep(), xValue(), and xInverse()
|
||||
methods pass true and xFinal() methods pass false.
|
||||
|
||||
@ -59,12 +62,12 @@ public final class sqlite3_context extends NativePointerHolder<sqlite3_context>
|
||||
key for mapping callback invocations to whatever client-defined
|
||||
state is needed by the UDF.
|
||||
|
||||
<p>There is one case where this will return 0 in the context of an
|
||||
aggregate or window function: if the result set has no rows,
|
||||
the UDF's xFinal() will be called without any other x...() members
|
||||
having been called. In that one case, no aggregate context key will
|
||||
have been generated. xFinal() implementations need to be prepared to
|
||||
accept that condition as legal.
|
||||
<p>There is one case where this will return null in the context
|
||||
of an aggregate or window function: if the result set has no
|
||||
rows, the UDF's xFinal() will be called without any other x...()
|
||||
members having been called. In that one case, no aggregate
|
||||
context key will have been generated. xFinal() implementations
|
||||
need to be prepared to accept that condition as legal.
|
||||
*/
|
||||
public synchronized Long getAggregateContext(boolean initIfNeeded){
|
||||
if( aggregateContext==null ){
|
||||
|
@ -609,7 +609,7 @@ public class SQLTester {
|
||||
}
|
||||
t.addTestScript(a);
|
||||
}
|
||||
final auto_extension_callback ax = new auto_extension_callback() {
|
||||
final AutoExtensionCallback ax = new AutoExtensionCallback() {
|
||||
private final SQLTester tester = t;
|
||||
@Override public int call(sqlite3 db){
|
||||
final String init = tester.getDbInitSql();
|
||||
|
Reference in New Issue
Block a user