Skip to content

Commit 30b932f

Browse files
authored
Add an input type for platform accounts (#357)
Add functions to upsert platform accounts (individually or in bulk) Keep the old create_account_in_space function as a shim for now. Use the new upsert_account in upsert_documents and upsert_content, allowing for more complete inline information.
1 parent 9922963 commit 30b932f

4 files changed

Lines changed: 458 additions & 26 deletions

File tree

packages/database/src/dbTypes.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,17 @@ export type Database = {
673673
Args: { p_account_id: number }
674674
Returns: boolean
675675
}
676+
upsert_account_in_space: {
677+
Args: {
678+
local_account: Database["public"]["CompositeTypes"]["account_local_input"]
679+
space_id_: number
680+
}
681+
Returns: number
682+
}
683+
upsert_accounts_in_space: {
684+
Args: { accounts: Json; space_id_: number }
685+
Returns: number[]
686+
}
676687
upsert_concepts: {
677688
Args: { data: Json; v_space_id: number }
678689
Returns: number[]
@@ -746,6 +757,13 @@ export type Database = {
746757
task_status: "active" | "timeout" | "complete" | "failed"
747758
}
748759
CompositeTypes: {
760+
account_local_input: {
761+
name: string | null
762+
account_local_id: string | null
763+
email: string | null
764+
email_trusted: boolean | null
765+
space_editor: boolean | null
766+
}
749767
concept_local_input: {
750768
epistemic_status: Database["public"]["Enums"]["EpistemicStatus"] | null
751769
name: string | null
@@ -786,10 +804,10 @@ export type Database = {
786804
| Database["public"]["CompositeTypes"]["document_local_input"]
787805
| null
788806
author_inline:
789-
| Database["public"]["Tables"]["PlatformAccount"]["Row"]
807+
| Database["public"]["CompositeTypes"]["account_local_input"]
790808
| null
791809
creator_inline:
792-
| Database["public"]["Tables"]["PlatformAccount"]["Row"]
810+
| Database["public"]["CompositeTypes"]["account_local_input"]
793811
| null
794812
embedding_inline:
795813
| Database["public"]["CompositeTypes"]["inline_embedding_input"]
@@ -808,7 +826,7 @@ export type Database = {
808826
author_local_id: string | null
809827
space_url: string | null
810828
author_inline:
811-
| Database["public"]["Tables"]["PlatformAccount"]["Row"]
829+
| Database["public"]["CompositeTypes"]["account_local_input"]
812830
| null
813831
}
814832
inline_embedding_input: {

0 commit comments

Comments
 (0)