#ifndef DBMS_VECTOR_INTERNAL_HPP #define DBMS_VECTOR_INTERNAL_HPP #include extern "C" { #include "postgres.h" #include "fmgr.h" #include "utils/jsonb.h" /* * Cluster-wide default of the vector index build checkpointing, mirrored * in the dbms_vector.vector_index_checkpointing GUC (registered in * guc_parameters.dat); per-index overrides live in * SYS.vector_index_checkpointing and the index reloption. */ extern bool dbms_vector_vector_index_checkpointing; // UTL_TO_EMBEDDING / UTL_TO_EMBEDDINGS Datum dbms_vector_utl_to_embedding(PG_FUNCTION_ARGS); Datum dbms_vector_utl_to_embeddings(PG_FUNCTION_ARGS); Datum dbms_vector_utl_to_embeddings_array(PG_FUNCTION_ARGS); // QUERY Datum dbms_vector_query(PG_FUNCTION_ARGS); Datum dbms_vector_query_text(PG_FUNCTION_ARGS); // LOAD_ONNX_MODEL / DROP_ONNX_MODEL Datum dbms_vector_load_onnx_model_dir(PG_FUNCTION_ARGS); Datum dbms_vector_load_onnx_model(PG_FUNCTION_ARGS); Datum dbms_vector_drop_onnx_model(PG_FUNCTION_ARGS); // CREATE_CREDENTIAL / DROP_CREDENTIAL Datum dbms_vector_create_credential(PG_FUNCTION_ARGS); Datum dbms_vector_drop_credential(PG_FUNCTION_ARGS); // Internal helper shared between the wrappers Datum dbms_vector_get_credential(PG_FUNCTION_ARGS); // ONNX runtime flavor probe: true on --with-onnxruntime builds Datum dbms_vector_onnx_enabled(PG_FUNCTION_ARGS); // Contract-phase stubs: frozen v1 SQL surface. All of these are stubs // raising the unified "not implemented yet" error until implemented. // UTL_TO_CHUNKS (clob / varchar2 overloads) - shared text core Datum dbms_vector_utl_to_chunks(PG_FUNCTION_ARGS); Datum dbms_vector_utl_to_chunks_1(PG_FUNCTION_ARGS); // UTL_TO_GENERATE_TEXT - shared text core Datum dbms_vector_utl_to_generate_text(PG_FUNCTION_ARGS); // CREATE_INDEX / REBUILD_INDEX Datum dbms_vector_create_index(PG_FUNCTION_ARGS); Datum dbms_vector_rebuild_index(PG_FUNCTION_ARGS); // GET_INDEX_STATUS Datum dbms_vector_get_index_status(PG_FUNCTION_ARGS); // INDEX_VECTOR_MEMORY_ADVISOR Datum dbms_vector_index_vector_memory_advisor(PG_FUNCTION_ARGS); // INMEMORY_ONNX_MODEL Datum dbms_vector_inmemory_onnx_model(PG_FUNCTION_ARGS); // ENABLE_CHECKPOINT / DISABLE_CHECKPOINT Datum dbms_vector_enable_checkpoint(PG_FUNCTION_ARGS); Datum dbms_vector_disable_checkpoint(PG_FUNCTION_ARGS); } // extern "C" /* * Public C++ API for other modules (e.g. DBMS_VECTOR_CHAIN): the credential * management core behind the SQL entry points. Both validate exactly like * the SQL wrappers (qualified name rules, owner-or-superuser checks, params * shape, duplicate/missing rows) and ereport(ERROR) on failure. A nullptr * params is the SQL NULL case. Credential resolution for REST consumers * (raw stored params, secrets included) lives in dbms_vector_rest.hpp. */ void dbms_vector_credential_create(const std::string &credential_name, Jsonb *params); void dbms_vector_credential_drop(const std::string &credential_name); #endif // DBMS_VECTOR_INTERNAL_HPP