mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Refactoring ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description Porting udfs into documentdb ---- #### AI description (iteration 1) #### PR Classification Code cleanup and feature enhancement. #### PR Summary This pull request continues the porting of UDFs into DocumentDB, updating and including various SQL files for better functionality and organization. - Updated `documentdb--0.24-0.sql` to include new UDFs and operators, replacing old function references. - Added new UDFs for query, projection, geospatial, aggregation, metadata, schema management, index management, CRUD commands, user management, schema validation, telemetry, TTL, vector search, extension version, diagnostic, and RBAC metadata. - Removed outdated function definitions and replaced them with updated SQL includes.
23 lines
795 B
SQL
23 lines
795 B
SQL
|
|
/*
|
|
* __API_SCHEMA__.collection() can be used to query collections, e.g.:
|
|
* SELECT * FROM __API_SCHEMA__.collection('db','collection')
|
|
*
|
|
* While this seems slow, we use the planner hook to replace this function
|
|
* directly with the table, so we usually do not call it directly.
|
|
*
|
|
* Output arguments need to match data tables exactly.
|
|
*/
|
|
CREATE OR REPLACE FUNCTION __API_SCHEMA_V2__.collection(
|
|
p_database_name text,
|
|
p_collection_name text,
|
|
OUT shard_key_value bigint,
|
|
OUT object_id __CORE_SCHEMA__.bson,
|
|
OUT document __CORE_SCHEMA__.bson,
|
|
OUT creation_time timestamptz)
|
|
RETURNS SETOF record
|
|
LANGUAGE c
|
|
STRICT
|
|
AS 'MODULE_PATHNAME', $function$command_api_collection$function$;
|
|
COMMENT ON FUNCTION __API_SCHEMA_V2__.collection(text,text)
|
|
IS 'query a collection'; |