MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / createExplicitPartitions

Function createExplicitPartitions

packages/sql/src/schema/partitioning.ts:337–351  ·  view source on GitHub ↗
(
  tableName: string,
  tableSchema: string | undefined,
  partitions: Exclude<EntityPartitionBy, { type: 'hash' }>['partitions'],
)

Source from the content-addressed store, hash-verified

335};
336
337const createExplicitPartitions = (
338 tableName: string,
339 tableSchema: string | undefined,
340 partitions: Exclude<EntityPartitionBy, { type: 'hash' }>['partitions'],
341): TablePartition[] =>
342 partitions.map((partition, index) => {
343 const resolvedName = partition.name ?? `${tableName}_${index}`;
344 const { name, schema } = splitPartitionName(resolvedName);
345
346 return {
347 name,
348 schema: schema ?? tableSchema,
349 bound: createPartitionBound(partition.values),
350 };
351 });
352
353/** @internal */
354export const getTablePartitioning = (

Callers 1

getTablePartitioningFunction · 0.85

Calls 3

splitPartitionNameFunction · 0.85
createPartitionBoundFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected