-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprega.nb.ts
24 lines (19 loc) · 879 Bytes
/
prega.nb.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//#nbts@code
import Surreal, {
RecordId,
} from "https://deno.land/x/[email protected]/mod.ts";
let db = new Surreal();
await db.connect("http://127.0.0.1:8000/rpc", {
namespace: "drugs",
database: "drugs",
});
//#nbts@code
let p = await db.query(/* surrealql */ `select categories, classification, class, description, superclass, (select name, actions.action from targets.target) as targets from drugs where name="Pregabalin"`);
p = p[0][0]; p
//#nbts@code
p = await db.query(/* surrealql */ `select name from drugs where "Voltage-dependent calcium channel subunit alpha-2/delta-1" in targets.target.name`);
p
//#nbts@code
p = await db.query(/* surrealql */ `select name, categories, classification, class, description, superclass, (select name, actions.action from targets.target) as targets from drugs where name = "Cyclandelate"`);
p
//#nbts@code