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 Move udf files from pg_helio_api -> pg_documentdb ---- #### AI description (iteration 1) #### PR Classification Code cleanup #### PR Summary This pull request moves User Defined Function (UDF) files from the `pg_helio_api` directory to the `pg_documentdb` directory. - Updated `pgmongo/sql/pgmongo--1.23-0--1.24-0.sql` to include UDFs from `pg_documentdb` instead of `pg_helio_api`. - Modified `oss/pg_helio_api/sql/pg_helio_api--1.15-0--1.16-0.sql` to reference UDFs from `pg_documentdb`. - Adjusted `oss/pg_helio_api/sql/pg_helio_api--1.10-0.sql` to include UDFs from `pg_documentdb`. - Updated `scripts/validate_helio_extension_state.sh` to add validation exceptions for the moved UDF files. - Changed `pgmongo/sql/pgmongo--1.21-0--1.22-0.sql` to reference UDFs from `pg_documentdb`.
23 lines
785 B
SQL
23 lines
785 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 helio_api.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 helio_api.collection(text,text)
|
|
IS 'query a Mongo collection'; |