public class DefaultStorIOSQLite extends StorIOSQLite
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultStorIOSQLite.Builder
Builder for
DefaultStorIOSQLite. |
static class |
DefaultStorIOSQLite.CompleteBuilder
Compile-time safe part of builder for
DefaultStorIOSQLite. |
protected class |
DefaultStorIOSQLite.InternalImpl
Deprecated.
|
protected class |
DefaultStorIOSQLite.LowLevelImpl
API for low level operations with
StorIOSQLite, we made it separate
to make StorIOSQLite API clean and easy to understand. |
StorIOSQLite.Internal, StorIOSQLite.LowLevel| Modifier | Constructor and Description |
|---|---|
protected |
DefaultStorIOSQLite(android.database.sqlite.SQLiteOpenHelper sqLiteOpenHelper,
TypeMappingFinder typeMappingFinder,
rx.Scheduler defaultScheduler) |
| Modifier and Type | Method and Description |
|---|---|
static DefaultStorIOSQLite.Builder |
builder()
Creates new builder for
DefaultStorIOSQLite. |
void |
close()
Closes underlying
SQLiteOpenHelper. |
rx.Scheduler |
defaultScheduler()
Provides a scheduler on which
Observable / Single
or Completable will be subscribed. |
StorIOSQLite.Internal |
internal()
Deprecated.
|
StorIOSQLite.LowLevel |
lowLevel()
An API for low level interaction with DB, it's part of public API, so feel free to use it,
but please read documentation carefully!
|
rx.Observable<Changes> |
observeChanges()
Allows observe changes in all tables of the db.
|
rx.Observable<Changes> |
observeChangesInTables(java.util.Set<java.lang.String> tables)
Allows observe changes of required tables.
|
rx.Observable<Changes> |
observeChangesOfTags(java.util.Set<java.lang.String> tags)
Allows observe changes of required tags.
|
delete, executeSQL, get, observeChangesInTable, observeChangesOfTag, putprotected DefaultStorIOSQLite(@NonNull
android.database.sqlite.SQLiteOpenHelper sqLiteOpenHelper,
@NonNull
TypeMappingFinder typeMappingFinder,
@Nullable
rx.Scheduler defaultScheduler)
@NonNull public rx.Observable<Changes> observeChanges()
StorIOSQLite knows only about changes
that happened as a result of Put or Delete Operations executed
on this instance of StorIOSQLite.
Emission may happen on any thread that performed Put or Delete operation,
so it's recommended to apply Observable.observeOn(rx.Scheduler)
if you need to receive events on a special thread.
Notice, that returned Observable is "Hot Observable", it never ends, which means,
that you should manually unsubscribe from it to prevent memory leak.
Also, it can cause BackPressure problems.observeChanges in class StorIOSQLiteObservable of Changes subscribed to changes of all tables.@NonNull public rx.Observable<Changes> observeChangesInTables(@NonNull java.util.Set<java.lang.String> tables)
StorIOSQLite knows only about changes
that happened as a result of Put or Delete Operations executed
on this instance of StorIOSQLite.
Emission may happen on any thread that performed Put or Delete operation,
so it's recommended to apply Observable.observeOn(rx.Scheduler)
if you need to receive events on a special thread.
Notice, that returned Observable is "Hot Observable", it never ends, which means,
that you should manually unsubscribe from it to prevent memory leak.
Also, it can cause BackPressure problems.observeChangesInTables in class StorIOSQLitetables - set of table names that should be monitored.Observable of Changes subscribed to changes of required tables.@NonNull public rx.Observable<Changes> observeChangesOfTags(@NonNull java.util.Set<java.lang.String> tags)
StorIOSQLite knows only about changes
that happened as a result of Put or Delete Operations executed
on this instance of StorIOSQLite.
Emission may happen on any thread that performed Put or Delete operation,
so it's recommended to apply Observable.observeOn(rx.Scheduler)
if you need to receive events on a special thread.
Notice, that returned Observable is "Hot Observable", it never ends, which means,
that you should manually unsubscribe from it to prevent memory leak.
Also, it can cause BackPressure problems.observeChangesOfTags in class StorIOSQLitetags - set of tags that should be monitored.Observable of Changes subscribed to changes of required tags.public rx.Scheduler defaultScheduler()
Observable / Single
or Completable will be subscribed.
defaultScheduler in class StorIOSQLitenull if it isn't needed to apply it.com.pushtorefresh.storio.operations.PreparedOperation#asRxObservable(),
com.pushtorefresh.storio.operations.PreparedOperation#asRxSingle(),
com.pushtorefresh.storio.operations.PreparedWriteOperation#asRxCompletable()@NonNull @Deprecated public StorIOSQLite.Internal internal()
internal in class StorIOSQLiteStorIOSQLite.@NonNull public StorIOSQLite.LowLevel lowLevel()
lowLevel in class StorIOSQLiteStorIOSQLite.public void close()
throws java.io.IOException
SQLiteOpenHelper.
All calls to this instance of StorIOSQLite
after call to this method can produce exceptions
and undefined behavior.
java.io.IOException@NonNull public static DefaultStorIOSQLite.Builder builder()
DefaultStorIOSQLite.DefaultStorIOSQLite.Builder.