mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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 ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description GW plumbing of compact command 1- Route the compact command to the backend. 2- Add a dummy C handler function for `compact` that does nothing and throws the same error. Next PR is going to add support for compact in the backend with blocking writes by running VACUUM FULL ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for the `compact` command in the MongoDB Postgres runtime. - Added `CompactAsync` method in `PostgresClient.cs` to handle the compact command. - Implemented `command_compact` function in the new file `compact.c`. - Updated `PostgresMongoClient.cs` to include the `CompactAsync` method. - Modified `MongoRequestParser.cs` to parse the compact command. - Added SQL function definitions for the compact command in `compact--0.103-0.sql` and `compact--latest.sql`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
10 lines
420 B
SQL
10 lines
420 B
SQL
-- compact database command implementation for the wire protocol
|
|
CREATE OR REPLACE FUNCTION __API_SCHEMA_V2__.compact(
|
|
IN p_spec __CORE_SCHEMA_V2__.bson)
|
|
RETURNS __CORE_SCHEMA_V2__.bson
|
|
LANGUAGE C
|
|
VOLATILE PARALLEL UNSAFE STRICT
|
|
AS 'MODULE_PATHNAME', $function$command_compact$function$;
|
|
COMMENT ON FUNCTION __API_SCHEMA_V2__.compact(__CORE_SCHEMA_V2__.bson)
|
|
IS 'Compact the collection data tables and indexes';
|