Skip to content

Commit 9758e53

Browse files
authored
ENG-833 Isolate node query functions. (#427)
* Utility query functions for the database * Use localIds as keys for node queries. Cache corresponding dbIds for efficiency. Some typechecks now require a newer typescript.
1 parent b688e35 commit 9758e53

File tree

6 files changed

+395
-4
lines changed

6 files changed

+395
-4
lines changed

package-lock.json

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/database/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"supabase": "^2.39.2",
5555
"ts-node-maintained": "^10.9.5",
5656
"tsx": "^4.20.3",
57+
"typescript": "5.9.2",
5758
"vercel": "46.1.1"
5859
},
5960
"prettier": {

packages/database/src/dbTypes.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,26 @@ export type Database = {
632632
Args: { space_id: number }
633633
Returns: boolean
634634
}
635+
instances_of_schema: {
636+
Args: { schema: Database["public"]["Tables"]["Concept"]["Row"] }
637+
Returns: {
638+
arity: number | null
639+
author_id: number | null
640+
created: string
641+
description: string | null
642+
epistemic_status: Database["public"]["Enums"]["EpistemicStatus"]
643+
id: number
644+
is_schema: boolean
645+
last_modified: string
646+
literal_content: Json
647+
name: string
648+
reference_content: Json
649+
refs: number[]
650+
represented_by_id: number | null
651+
schema_id: number | null
652+
space_id: number
653+
}[]
654+
}
635655
match_content_embeddings: {
636656
Args: {
637657
current_document_id?: number
@@ -669,6 +689,26 @@ export type Database = {
669689
}
670690
Returns: string
671691
}
692+
schema_of_concept: {
693+
Args: { concept: Database["public"]["Tables"]["Concept"]["Row"] }
694+
Returns: {
695+
arity: number | null
696+
author_id: number | null
697+
created: string
698+
description: string | null
699+
epistemic_status: Database["public"]["Enums"]["EpistemicStatus"]
700+
id: number
701+
is_schema: boolean
702+
last_modified: string
703+
literal_content: Json
704+
name: string
705+
reference_content: Json
706+
refs: number[]
707+
represented_by_id: number | null
708+
schema_id: number | null
709+
space_id: number
710+
}[]
711+
}
672712
unowned_account_in_shared_space: {
673713
Args: { p_account_id: number }
674714
Returns: boolean

0 commit comments

Comments
 (0)