Skip to content

Commit 3a6d663

Browse files
committed
linting
1 parent 72abee3 commit 3a6d663

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

packages/database/scripts/bench.mts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ import {
1616
} from "@repo/database/lib/queries";
1717
import { createClient } from "@repo/database/lib/client";
1818
import { config } from "@repo/database/dbDotEnv";
19+
import type { Tables } from "@repo/database/dbTypes";
1920
import {
2021
fetchOrCreateSpaceDirect,
2122
createLoggedInClient,
2223
} from "@repo/database/lib/contextFunctions";
2324

25+
type ConceptKA = (keyof Tables<"Concept">)[];
26+
2427
config();
2528
const platform = "Roam";
2629
let supabase = createClient();
@@ -38,6 +41,7 @@ if (error || !data || !data.id) {
3841
const spaceId = data.id;
3942
supabase = await createLoggedInClient(platform, spaceId, "password");
4043
if (!supabase) process.exit(1);
44+
/* eslint-disable @typescript-eslint/naming-convention */
4145
const queries = {
4246
"Query all nodes": { schemaLocalIds: [], fetchNodes: true },
4347
"Query all relations": { schemaLocalIds: [], fetchNodes: false },
@@ -59,20 +63,20 @@ const queries = {
5963
// Previous will be slow, more efficient to filter on base node, and in some relation, as follows:
6064
"Query all nodes of a given type in some relation": {
6165
schemaLocalIds: ["hypothesis"],
62-
relationFields: ["id"] as any,
66+
relationFields: ["id"] as ConceptKA,
6367
},
6468
"Query all nodes in some relation to a node of a certain author": {
6569
schemaLocalIds: [],
6670
inRelsToNodesOfAuthor: "account_3",
67-
relationFields: ["id"] as any,
68-
relationSubNodesFields: ["id"] as any,
71+
relationFields: ["id"] as ConceptKA,
72+
relationSubNodesFields: ["id"] as ConceptKA,
6973
},
7074
// Previous will be slow, more efficient to start on given type, and in some relation, as follows:
7175
"Query all nodes of a certain author in some relation": {
7276
schemaLocalIds: [],
7377
nodeAuthor: "account_3",
74-
relationFields: ["id"] as any,
75-
relationSubNodesFields: ["id"] as any,
78+
relationFields: ["id"] as ConceptKA,
79+
relationSubNodesFields: ["id"] as ConceptKA,
7680
},
7781
"In relation to a specific node.": {
7882
schemaLocalIds: [],
@@ -81,10 +85,11 @@ const queries = {
8185
"A specific node's relation.": {
8286
schemaLocalIds: [],
8387
baseNodeLocalIds: ["claim_11"],
84-
relationFields: ["id"] as any,
85-
relationSubNodesFields: ["id"] as any,
88+
relationFields: ["id"] as ConceptKA,
89+
relationSubNodesFields: ["id"] as ConceptKA,
8690
},
8791
};
92+
/* eslint-enable @typescript-eslint/naming-convention */
8893
await getSchemaConcepts(supabase, spaceId, true);
8994
const benches = [];
9095
for (const [description, query] of Object.entries(queries)) {

0 commit comments

Comments
 (0)