CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/database/user-query/index.ts
Views: 687
1
import { db } from "@cocalc/database";
2
import { callback2 } from "@cocalc/util/async-utils";
3
4
type Query = any; // TODO
5
type Option = any; // TODO
6
7
interface Options {
8
client_id?: string; // if given, uses to control number of queries at once by one client.
9
account_id?: string; // at least one of account_id or project_id must be specified
10
project_id?: string;
11
query: Query;
12
options?: Option[];
13
}
14
15
export default async function userQuery({
16
client_id,
17
account_id,
18
project_id,
19
query,
20
options,
21
}: Options): Promise<Query> {
22
return await callback2(db().user_query, {
23
client_id,
24
account_id,
25
project_id,
26
query,
27
options,
28
});
29
}
30
31