Amazon QLDB driver for Go
Important
End of support notice: Existing customers will be able to use Amazon QLDB until end of support on 07/31/2025. For more details, see
Migrate an Amazon QLDB Ledger to Amazon Aurora PostgreSQL
To work with data in your ledger, you can connect to Amazon QLDB from your Go application by using an AWS provided driver. The following topics describe how to get started with the QLDB driver for Go.
Driver resources
For more information about the functionality supported by the Go driver, see the following resources:
Prerequisites
Before you get started with the QLDB driver for Go, you must do the following:
-
Follow the AWS setup instructions in Accessing Amazon QLDB. This includes the following:
-
Sign up for AWS.
-
Create a user with the appropriate QLDB permissions.
-
Grant programmatic access for development.
-
-
(Optional) Install an integrated development environment (IDE) of your choice. For a list of commonly used IDEs for Go, see Editor plugins and IDEs
on the Go website. -
Download and install one of the following versions of Go from the Go downloads
site: -
1.15 or later – QLDB driver for Go v3
-
1.14 – QLDB driver for Go v1 or v2
-
-
Configure your development environment for the AWS SDK for Go
: -
Set up your AWS credentials. We recommend creating a shared credentials file.
For instructions, see Specifying Credentials
in the AWS SDK for Go Developer Guide. -
Set your default AWS Region. To learn how, see Specifying the AWS Region
. For a complete list of available Regions, see Amazon QLDB endpoints and quotas in the AWS General Reference.
-
Next, you can set up a basic sample application and run short code examples—or you can install the driver in an existing Go project.
-
To install the QLDB driver and the AWS SDK for Go in an existing project, proceed to Installation.
-
To set up a project and run short code examples that demonstrate basic data transactions on a ledger, see the Quick start tutorial.
Installation
The QLDB driver for Go is open source in the GitHub repository awslabs/amazon-qldb-driver-go
To install the driver
-
Ensure that your project is using Go modules
to install project dependencies. -
In your project directory, enter the following
go get
command.
Installing the driver also installs its dependencies, including the AWS SDK for Go
For short code examples of how to run basic data transactions on a ledger, see the Cookbook reference.