Table Definition

services/functions/data/sessions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import aws from "aws-sdk"
import { Entity, Table } from "dynamodb-toolbox"
import { ulid } from "ulid"
import dayjs from "dayjs"
const DocumentClient = new aws.DynamoDB.DocumentClient();

export const SessionTable = new Table({
    name: process.env.sessionTableName ?? "NO TABLE FOUND IN ENVIRONMENT!",
    partitionKey: "pk",
    sortKey: "sk",
    indexes: {
      GSI1: { partitionKey: 'gsi1pk', sortKey: 'gsi1sk' },
    },
  
    DocumentClient,
});
D
Image of Dylan Lacey
Dylan Lacey
@dylanlacey
powered byLogosnappify