0
Get Database
One script reply has been approved by the moderators Verified
Created by adam186 615 days ago Viewed 9278 times
0
Submitted by adam186 Deno
Verified 615 days ago
1
import { Client, Databases } from "https://deno.land/x/appwrite@7.0.0/mod.ts";
2

3
type Appwrite = {
4
  endpoint: string;
5
  project: string;
6
  key: string;
7
  self_signed: boolean;
8
};
9
export async function main(auth: Appwrite, id: string) {
10
  const client = new Client()
11
    .setEndpoint(auth.endpoint)
12
    .setProject(auth.project)
13
    .setKey(auth.key);
14
  const db = new Databases(client);
15

16
  return await db.get(id);
17
}
18