Skip to main content
Module

x/earthstar_replica_server/deps.ts>Earthstar.DocDriverSqlite

An always-online Earthstar peer for your shares.
Latest
class Earthstar.DocDriverSqlite
implements IReplicaDocDriver
import { Earthstar } from "https://deno.land/x/earthstar_replica_server@4.0.0-beta.1/deps.ts";
const { DocDriverSqlite } = Earthstar;

A strorage driver which persists to SQLite. Works in Deno and browsers.

Constructors

new
DocDriverSqlite(opts: ReplicaSqliteOpts)

Properties

_db: Sqlite.DB
_filename: string
_isClosed: boolean
_maxLocalIndex: number

Methods

private
ensureTables()
private
queryDocsSync(queryToClean: Query<string[]>): DocBase<string>[]
private
upsertSync<DocType extends DocBase<string>>(doc: DocType): DocType
_getConfigSync(key: string): string | undefined
close(erase: boolean): Promise<void>
deleteConfig(key: string): Promise<boolean>
getConfig(key: string): Promise<string | undefined>
getMaxLocalIndex(): Promise<number>
isClosed(): boolean
listConfigKeys(): Promise<string[]>
queryDocs(queryToClean: Query<string[]>): Promise<DocBase<string>[]>
setConfig(key: string, content: string): Promise<void>
upsert<DocType extends DocBase<string>>(doc: DocType): Promise<DocType>