Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
import { createContext, useContext } from "react";
import type { SchemaEditorContextValue } from "./types";
const SchemaEditorContext = createContext<SchemaEditorContextValue | null>(
null
);
export function SchemaEditorProvider({
value,
children,
}: {
value: SchemaEditorContextValue;
children: React.ReactNode;
}) {
return (
<SchemaEditorContext.Provider value={value}>
{children}
</SchemaEditorContext.Provider>
);
}
export function useSchemaEditorContext(): SchemaEditorContextValue {
const context = useContext(SchemaEditorContext);
if (!context) {
throw new Error(
"useSchemaEditorContext must be used within a SchemaEditorProvider"
);
}
return context;
}