sqlite_crdt library

Classes

Batch
A batch is used to perform multiple operation as a single atomic unit. A Batch object can be acquired by calling Database.batch. It provides methods for adding operation. None of the operation will be executed (or visible locally) until commit() is called.
Crdt
CrdtApi
Interface to normalize CRDT query and execute methods
CrdtExecutor
CrdtTableExecutor
Intercepts CREATE TABLE queries to assist with table creation and updates. Does not impact any other query types.
CrdtWriteExecutor
Database
Database to send sql commands, created during openDatabase
DatabaseApi
Interface representing a "standard" database backend capable of read, write and transaction operations.
DatabaseExecutor
Common API for Database and Transaction to execute SQL commands
DatabaseFactory
Basic databases operations
Hlc
A Hybrid Logical Clock implementation. This class trades time precision for a guaranteed monotonically increasing clock in distributed systems. Inspiration: https://cse.buffalo.edu/tech-reports/2014-04.pdf
MergeError<T>
Thrown on merge errors. Contains the failed payload to help with debugging large datasets.
OpenDatabaseOptions
Options for opening the database see openDatabase for details
QueryCursor
Cursor for query by page cursor.
ReadApi
Interface implementing read operations on the underlying database.
ReadWriteApi
Interface implementing read and write operations on the underlying database.
SqlCrdt
SqliteCrdt
Transaction
Database transaction to use during a transaction
WriteApi
Interface implementing write operations on the underlying database.

Enums

ConflictAlgorithm
Insert/Update conflict resolver

Constants

inMemoryDatabasePath → const String
Special database name opened in memory

Properties

onDatabaseDowngradeDelete OnDatabaseVersionChangeFn
Downgrading will delete the database and open it again.
final
sqfliteLogLevelNone int
No logs
final
sqfliteLogLevelSql int
Log native sql commands
final
sqfliteLogLevelVerbose int
Log native verbose
final

Functions

generateNodeId() String
onDatabaseVersionChangeError(Database db, int oldVersion, int newVersion) Future<void>
to specify during openDatabase for onDowngrade Downgrading will always fail
parseCrdtChangeset(Map<String, dynamic> message) CrdtChangeset
Utility function to simplify parsing untyped changesets. It performs all necessary casts to satisfy Dart's type system, and parses Hlc timestamps. Useful when receiving datasets over the wire.

Typedefs

CrdtChangeset = Map<String, CrdtTableChangeset>
CrdtRecord = Map<String, Object?>
CrdtTableChangeset = List<CrdtRecord>
OnDatabaseConfigureFn = FutureOr<void> Function(Database db)
Prototype of the function called before calling onCreate/onUpdate/onOpen when the database is open.
OnDatabaseCreateFn = FutureOr<void> Function(Database db, int version)
Prototype of the function called when the database is created.
OnDatabaseOpenFn = FutureOr<void> Function(Database db)
Prototype of the function called when the database is open.
OnDatabaseVersionChangeFn = FutureOr<void> Function(Database db, int oldVersion, int newVersion)
Prototype of the function called when the version has changed.
Query = (String, List<Object?>)

Exceptions / Errors

ClockDriftException
DatabaseException
Wrap sqlite native exception
DuplicateNodeException
OverflowException