Skip to content

Add DynamoDB connector to Typescript SDK#165

Open
sandshoes wants to merge 2 commits into
mainfrom
add-dynamodb-connector-to-sdk
Open

Add DynamoDB connector to Typescript SDK#165
sandshoes wants to merge 2 commits into
mainfrom
add-dynamodb-connector-to-sdk

Conversation

@sandshoes

Copy link
Copy Markdown

This implements the DynamoDB connector in a functionality mirroring the changes added to the Tinybird Forward CLI.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class DynamoDB connector support to the Tinybird TypeScript SDK, covering schema definitions, file generation, and migration parsing/emission so DynamoDB resources can be defined and migrated similarly to existing Kafka/S3/GCS connectors.

Changes:

  • Add defineDynamoDBConnection + DynamoDB connection types and runtime validators.
  • Add DynamoDB datasource ingestion config (dynamodb) and enforce “only one ingestion option” across schema/generators/tests.
  • Extend migration tooling (parse/emit + CLI migrate validation) and documentation to support DynamoDB connections and datasource directives.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/schema/datasource.ts Adds DynamoDBConfig and dynamodb ingestion option with updated ingestion exclusivity check.
src/schema/datasource.test.ts Updates ingestion-exclusivity error message expectations to include DynamoDB.
src/schema/connection.ts Adds DynamoDB connection types, defineDynamoDBConnection, and isDynamoDBConnectionDefinition.
src/schema/connection.test.ts Adds unit tests for DynamoDB connection creation/validation + type guard.
src/migrate/types.ts Extends migration models to represent DynamoDB datasource + connection resources.
src/migrate/parse-datasource.ts Parses DynamoDB datasource import directives and maps them into migration models.
src/migrate/parse-connection.ts Parses TYPE dynamodb connections and validates directive compatibility.
src/migrate/parse-connection.test.ts Adds migration parser tests for DynamoDB connections and error cases.
src/migrate/emit-ts.ts Emits TS for DynamoDB connections/datasource ingestion + secret-template detection.
src/index.ts Exposes DynamoDB connection APIs/types and datasource DynamoDB config type from the SDK entrypoint.
src/generator/datasource.ts Emits DynamoDB datasource directives (IMPORT_TABLE_ARN, IMPORT_EXPORT_BUCKET) and updates ingestion exclusivity.
src/generator/datasource.test.ts Adds generator tests for DynamoDB datasource directives and ingestion exclusivity.
src/generator/connection.ts Emits .connection content for DynamoDB connections.
src/generator/connection.test.ts Adds generator test for DynamoDB .connection output.
src/cli/commands/migrate.ts Validates DynamoDB datasources reference a dynamodb connection type during migration.
src/cli/commands/migrate.test.ts Adds end-to-end migrate tests for DynamoDB connection + datasource directives and validation failures.
README.md Documents DynamoDB connection/datasource usage examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +586 to +596
// DynamoDB import directives share IMPORT_CONNECTION_NAME with blob storage,
// so treat the import block as DynamoDB whenever a DynamoDB-only directive is present.
const isDynamoDB = importTableArn !== undefined || importExportBucket !== undefined;

const dynamodb = isDynamoDB
? {
connectionName: importConnectionName ?? "",
tableArn: importTableArn ?? "",
exportBucket: importExportBucket ?? "",
}
: undefined;
@rmorehig

rmorehig commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants