import { DataType } from "@/lib/schemas/data-type-schema"; import { FieldInsertType, FieldType } from "@/lib/schemas/field-schema"; import { RelationshipInsertType, RelationshipType } from "@/lib/schemas/relationship-schema"; import { TableInsertType, TableType } from "@/lib/schemas/table-schema"; import { QueryResult } from "@powersync/web"; import { createContext } from "react"; export interface DatabaseContextType { tables: TableType[], data_types: DataType[] , relationships : RelationshipType[] , // table operations createTable: (table: TableInsertType) => Promise, editTable: (table: TableInsertType) => Promise, deleteTable: (id: string) => Promise, // field operations createField: (field: FieldInsertType) => Promise, editField: (field: FieldInsertType) => Promise, deleteField: (id: string) => Promise, orderTableFields: (fields: FieldType[]) => Promise , // relationship operations createRelationship : ( relationship : RelationshipInsertType) => Promise , editRelationship : ( relationship : RelationshipInsertType) => Promise , deleteRelationship : ( id : string) => Promise , } export default createContext({} as DatabaseContextType);