Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Document ¶
Document returns a sql.Scanner that can scan DynamoDB items into a struct or map using dynamodbattribute.UnmarshalMap (https://godoc.org/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute). Refer to the library docs for usage.
func NewDBWithClient ¶
func NewDBWithClient(ddb dynamodbiface.DynamoDBAPI) *sql.DB
NewDBWithClient returns a sql.DB backed by dynamosql using the given DynamoDB client.
Types ¶
type Config ¶
type Config struct { // If set, the driver will use this DynamoDB client. The Session param and the connection string will be ignored DynamoDB dynamodbiface.DynamoDBAPI // If set, and DynamoDB is not set, the driver will try to create a DynamoDB client using this session. Session *session.Session // If set, the wrapper collections []*dynamodb.AttributeValue, map[string]*dynamodb.AttributeValue will be mapped // unmarshaled into using the dynamodbattribute package into []interface{} and map[string]interface{}, respectively. AlwaysConvertCollectionsToGoType bool }
Config provides optional settings to the DynamoDB driver.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is the DynamoDB SQL driver.
func New ¶
New creates a Driver instance using a custom config. This may be easier to use than via sql.Open. A driver created using this function can be used to obtain a sql.DB like so
driver, err := New(Config{Session: sess}).OpenConnector("") db := sql.OpenDB(driver)
Click to show internal directories.
Click to hide internal directories.