Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/replica/doc_drivers/sqlite.shared.ts>CREATE_DOCS_TABLE_QUERY

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
variable CREATE_DOCS_TABLE_QUERY
import { CREATE_DOCS_TABLE_QUERY } from "https://deno.land/x/earthstar@v10.0.0-alpha.4/src/replica/doc_drivers/sqlite.shared.ts";

type

`CREATE TABLE IF NOT EXISTS docs ( doc TEXT NOT NULL, pathAuthor TEXT NOT NULL, localIndex NUMBER NOT NULL UNIQUE, format TEXT GENERATED ALWAYS AS (json_extract(doc, '$.format')) VIRTUAL NOT NULL, path TEXT GENERATED ALWAYS AS (json_extract(doc, '$.path')) VIRTUAL NOT NULL, author TEXT GENERATED ALWAYS AS (json_extract(doc, '$.author')) VIRTUAL NOT NULL, timestamp NUMBER GENERATED ALWAYS AS (json_extract(doc, '$.timestamp')) VIRTUAL NOT NULL, signature TEXT GENERATED ALWAYS AS (json_extract(doc, '$.signature')) VIRTUAL NOT NULL, deleteAfter NUMBER GENERATED ALWAYS AS (json_extract(doc, '$.deleteAfter')) VIRTUAL, PRIMARY KEY(pathAuthor) );`