Interface FullCreateTablePrimaryKeyDefinition<PKCols>

Overview

If your table has multiple columns in its primary key, you may use the full primary key definition syntax to express that:

primaryKey: {
partitionBy: ['pt_key1', 'pt_key2'],
partitionSort: { cl_key1: 1, cl_key2: -1 },
}

Note that, if you don't have any clustering keys (partition sorts), you can omit the partitionSort field entirely:

primaryKey: {
partitionBy: ['pt_key1', 'pt_key2'],
}

A sort of 1 on the clustering column means ascending, and a sort of -1 means descending.

The shorthand syntax

If your table definition only has a single partition key, and no clustering keys (partition sorts), you can use the shorthand syntax instead:

primaryKey: 'pt_key',
interface FullCreateTablePrimaryKeyDefinition<PKCols> {
    partitionBy: readonly PKCols[];
    partitionSort?: Partial<Record<PKCols, -1 | 1>>;
}

Type Parameters

  • PKCols extends string

Properties

partitionBy: readonly PKCols[]
partitionSort?: Partial<Record<PKCols, -1 | 1>>