SQLiteEventStore

class SQLiteEventStore(context: Context, namespace: String) : EventStore

Helper class for storing, getting and removing events from the SQLite database.

Parameters

context

The android context object

Constructors

Link copied to clipboard
fun SQLiteEventStore(context: Context, namespace: String)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun add(payload: Payload)

Adds an event to the store.

Link copied to clipboard
fun close()

Closes the database

Link copied to clipboard

Returns a descending range of events from the top of the database.

Link copied to clipboard
open override fun getEmittableEvents(queryLimit: Int): List<EmitterEvent?>

Returns a list of EmittableEvent objects which contains events and related ids.

Link copied to clipboard
fun getEvent(id: Long): Map<String, Any?>?

Returns a Map containing the event payload values, the table row ID and the date it was created.

Link copied to clipboard
fun insertEvent(payload: Payload): Long

Inserts a payload into the database

Link copied to clipboard
fun open()

Opens a new writable database if it is currently closed.

Link copied to clipboard
open override fun removeAllEvents(): Boolean

Empties the store of all the events.

Link copied to clipboard
open override fun removeEvent(id: Long): Boolean

Removes an event from the store.

Link copied to clipboard
open override fun removeEvents(ids: MutableList<Long?>): Boolean

Removes a range of events from the store.

Link copied to clipboard
open override fun size(): Long

Returns amount of events currently in the store.

Properties

Link copied to clipboard

Returns a list of all the events in the database.

Link copied to clipboard

Returns truth on if database is open.

Link copied to clipboard

Returns the last rowId to be inserted.