Skip to main content
Version: v2

Synchronizer

Uploads your Database configuration to DynamoDB-Toolshack:

import { Synchronizer } from 'dynamodb-toolbox/database/actions/synchronize'

await pokeDB
.build(Synchronizer)
.awsAccount({
awsAccountId: '398259209128',
awsRegion: 'us-east-1'
})
.sync({ apiKey: '<YOUR_API_KEY_HERE>' })

Request​

.awsAccount(...)​

(required)

Defines the AWS accountId and region associated with the Database. You can optionally include metadata:

await PokeTable.build(Synchronizer)
.awsAccount({
awsAccountId: '398259209128',
awsRegion: 'us-east-1',
// πŸ‘‡ Optional metadata
title: 'Dev',
description: 'Development environment account',
// πŸ‘‡ https://ui.shadcn.com/colors
awsAccountColor: 'blue'
})
.sync(...)

Methods​

.sync(...)​

Uploads the configuration to DynamoDB-Toolshack:

await PokeTable.build(Synchronizer)
.awsAccount(...)
.sync({
// πŸ‘‡ https://app.dynamodb-toolshack.com/api-keys
apiKey: '<API_KEY>',
// πŸ‘‡ (optional) Keep only specified entities (`false` by default)
deleteUnknownEntities: true,
})

Adding Metadata​

Additional DynamoDB-Toolshack metadataβ€”such as Table and Entity titles, descriptions, and iconsβ€”can be defined directly inside the meta property of each Table and Entity.

Table​

Use the standard metadata fields to define a Table’s title and description. You can customize the icon and accessRole attributes under the _ddbToolshack key:

export const PokeTable = new Table({
...
meta: {
title: 'Pokedex',
description: 'An Awesome Table for development use',
_ddbToolshack: {
// πŸ‘‡ https://lucide.dev/icons/
icon: 'database-zap',
accessRole: {
roleName: 'DynamoDBToolshackAccountAccessRole',
description: 'Optional role description'
}
}
}
})

Entity​

Use the standard metadata fields to define an Entity's title and description. You can customize the icon attribute under the _ddbToolshack key:

export const PokemonEntity = new Entity({
...
meta: {
title: 'Pokemon',
description: 'An Awesome Entity for development use',
_ddbToolshack: {
// πŸ‘‡ https://lucide.dev/icons/
icon: 'cat'
}
}
})