First attempt at a resultset pseudovar

The resultset needs a table set, so rs:new will also assume the current table.
This commit is contained in:
Leon Mika 2025-05-17 22:16:49 +10:00
parent 6bf721873b
commit 18ffe85a56
8 changed files with 87 additions and 6 deletions

View file

@ -2,6 +2,7 @@ package testdynamo
import (
"context"
"os"
"testing"
"github.com/aws/aws-sdk-go-v2/aws"
@ -28,8 +29,13 @@ func SetupTestTable(t *testing.T, testData []TestData) *dynamodb.Client {
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider("abc", "123", "")))
assert.NoError(t, err)
testDynamoURL, ok := os.LookupEnv("TEST_DYNAMO_URL")
if !ok {
testDynamoURL = "http://localhost:4566"
}
dynamoClient := dynamodb.NewFromConfig(cfg,
dynamodb.WithEndpointResolver(dynamodb.EndpointResolverFromURL("http://localhost:4566")))
dynamodb.WithEndpointResolver(dynamodb.EndpointResolverFromURL(testDynamoURL)))
for _, table := range testData {
tableInput := &dynamodb.CreateTableInput{