Mobile app PoC (#281)

Initial checkin of mobile "native" app
This commit is contained in:
Zef Hemel
2023-01-08 12:24:12 +01:00
committed by GitHub
parent dc7de9d8f9
commit 0365673c41
61 changed files with 5190 additions and 155 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
// import { Knex } from "knex";
import { SysCallMapping } from "../../plugos/system.ts";
import { Query, queryToSql } from "../../plugos/syscalls/store.deno.ts";
import { AsyncSQLite } from "../../plugos/sqlite/async_sqlite.ts";
import { Query, queryToSql } from "../../plugos/syscalls/store.sqlite.ts";
import { ISQLite } from "../../plugos/sqlite/sqlite_interface.ts";
type Item = {
page: string;
@@ -16,7 +16,7 @@ export type KV = {
const tableName = "page_index";
export async function ensureTable(db: AsyncSQLite): Promise<void> {
export async function ensureTable(db: ISQLite): Promise<void> {
const result = await db.query(
`SELECT name FROM sqlite_master WHERE type='table' AND name=?`,
tableName,
@@ -32,7 +32,7 @@ export async function ensureTable(db: AsyncSQLite): Promise<void> {
}
}
export function pageIndexSyscalls(db: AsyncSQLite): SysCallMapping {
export function pageIndexSyscalls(db: ISQLite): SysCallMapping {
const apiObj: SysCallMapping = {
"index.set": async (_ctx, page: string, key: string, value: any) => {
await db.execute(