( meta: EntityMetadata, tableSchema: string | undefined, quoteIdentifier: (id: string) => string = id => id, )
| 352 | |
| 353 | /** @internal */ |
| 354 | export const getTablePartitioning = ( |
| 355 | meta: EntityMetadata, |
| 356 | tableSchema: string | undefined, |
| 357 | quoteIdentifier: (id: string) => string = id => id, |
| 358 | ): TablePartitioning | undefined => { |
| 359 | if (!meta.partitionBy) { |
| 360 | return undefined; |
| 361 | } |
| 362 | |
| 363 | const definition = createPartitionDefinition( |
| 364 | meta.partitionBy.type, |
| 365 | resolvePartitionExpression(meta, meta.partitionBy.expression, quoteIdentifier), |
| 366 | ); |
| 367 | const partitions = |
| 368 | meta.partitionBy.type === 'hash' |
| 369 | ? createHashPartitions(meta.tableName, tableSchema, meta.partitionBy.partitions) |
| 370 | : createExplicitPartitions(meta.tableName, tableSchema, meta.partitionBy.partitions); |
| 371 | |
| 372 | return { definition, partitions }; |
| 373 | }; |
| 374 | |
| 375 | /** @internal */ |
| 376 | export const diffPartitioning = ( |
no test coverage detected