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

3
/**
4
 * @param queries Array of query strings. Learn more about queries here:
5
 * https://appwrite.io/docs/queries
6
 *
7
 * @param search Search term to filter your list results.
8
 */
9
type Appwrite = {
10
  endpoint: string;
11
  project: string;
12
  key: string;
13
  self_signed: boolean;
14
};
15
export async function main(
16
  auth: Appwrite,
17
  queries?: string[],
18
  search?: string,
19
) {
20
  const client = new Client()
21
    .setEndpoint(auth.endpoint)
22
    .setProject(auth.project)
23
    .setKey(auth.key);
24
  const db = new Databases(client);
25

26
  return await db.list(queries, search);
27
}
28