-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added abort signal support for dynamo readonly functions
- Loading branch information
1 parent
c745667
commit d74b44a
Showing
8 changed files
with
55 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './connection' | ||
export * from './dynamodb-connection' | ||
export * from './request-options' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface IRequestOptions { | ||
abortSignal?: AbortSignal | ||
} | ||
|
||
export function isRequestOptions(value: unknown): value is IRequestOptions { | ||
return typeof value === 'object' && value != null && 'abortSignal' in value | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { type DescribeTableCommandInput, type TableDescription } from '@aws-sdk/client-dynamodb' | ||
import { type Schema } from './schema' | ||
import { type IRequestOptions } from '../connections' | ||
|
||
export async function describeTable(schema: Schema): Promise<TableDescription> { | ||
export async function describeTable(schema: Schema, requestOptions?: IRequestOptions): Promise<TableDescription> { | ||
const params: DescribeTableCommandInput = { | ||
TableName: schema.name, | ||
} | ||
|
||
const result = await schema.dynamo.describeTable(params) | ||
const result = await schema.dynamo.describeTable(params, requestOptions) | ||
return result.Table as TableDescription | ||
} |