Skip to content

okurashoichi/dynamodb-enhanced-codegen

Repository files navigation

DynamoDB Enhanced Codegen Plugin

This project is a Gradle plugin that generates Kotlin code based on DynamoDB table schemas using the DynamoDB Enhanced Client.

Features

  • Scans DynamoDB table schemas and generates Kotlin classes automatically
  • Supports local DynamoDB endpoints
  • Uses Freemarker as the template engine

Installation

Add the following to your build.gradle.kts:

plugins {
    id("io.github.okurashoichi.dynamodb.enhanced.codegen") version "latest"
}

Usage

Start DynamoDB Local. Add the plugin configuration to your build.gradle.kts

dynamoDbEnhancedClientCodeGen {
    region = "us-west-2"
    tableNames = listOf("Your", "Table", "Names")
    outputDir = "$buildDir/generated-src"
    endpoint = "http://localhost:8000" // Set the endpoint
    packageName = "com.example.generated"
}

Run the Gradle task to generate the code

./gradlew generateDynamoDbCode

Configuration Options

  • region: The region of DynamoDB
  • tableNames: List of table names to scan
  • outputDir: Output directory for the generated code
  • endpoint: The endpoint of DynamoDB

About

Generates DynamoDB Enhanced Client classes

Resources

Stars

Watchers

Forks

Packages

No packages published