UNPKG

@clickup/pg-microsharding

Version:
31 lines (20 loc) 1.17 kB
[**@clickup/pg-microsharding**](../README.md) *** [@clickup/pg-microsharding](../globals.md) / cleanup # Function: cleanup() > **cleanup**(`__namedParameters`): `Promise`\<`void`\> Defined in: [src/api/cleanup.ts:14](https://github.com/clickup/pg-microsharding/blob/master/src/api/cleanup.ts#L14) Removes old and semi-migrated schemas, and optionally orphan microshard schemas (those matching the microshard pattern but absent from the active shards list). ## Parameters | Parameter | Type | | ------ | ------ | | `__namedParameters` | \{ `dsn`: `string`; `noOldShards`: (`oldSchemaNameRe`) => `Promise`\<`void`\>; `confirm`: (`schemas`) => `Promise`\<`boolean`\>; `noOrphanShards`: () => `Promise`\<`void`\>; `confirmOrphanShards`: (`schemas`) => `Promise`\<`boolean`\>; \} | | `__namedParameters.dsn` | `string` | | `__namedParameters.noOldShards`? | (`oldSchemaNameRe`) => `Promise`\<`void`\> | | `__namedParameters.confirm`? | (`schemas`) => `Promise`\<`boolean`\> | | `__namedParameters.noOrphanShards`? | () => `Promise`\<`void`\> | | `__namedParameters.confirmOrphanShards`? | (`schemas`) => `Promise`\<`boolean`\> | ## Returns `Promise`\<`void`\>