Go
The following projects can be used to implement Golang applications using the YugabyteDB YSQL API.
| Project (* Recommended) | Type | Support | Examples |
|---|---|---|---|
| PGX Driver* | Driver | Full | Hello World CRUD |
| PQ Driver | Go Driver | Full | Hello World CRUD |
| GORM* | ORM | Full | Hello World CRUD |
| GO-PG | ORM | Full | Hello World CRUD |
Learn how to establish a connection to a YugabyteDB database and begin basic CRUD operations using the Hello World examples.
For fully-runnable code snippets and explanations of common operations, see the project page CRUD example. Before running CRUD examples, make sure you have installed the prerequisites.
For reference documentation, including using projects with SSL, refer to the drivers and ORMs reference pages.
Prerequisites
To develop Golang applications for YugabyteDB, you need the following:
-
Go
Install the latest Go (1.16 or later) on your system.
Rungo --versionin a terminal to check your version of Go. To install Go, visit Go Downloads. -
Create a Go project
For ease-of-use, use an integrated development environment (IDE), such as IntelliJ IDEA or Visual Studio Code, to develop your Go project. -
YugabyteDB cluster
- Create a free cluster on YugabyteDB Managed. Refer to Create a free cluster. Note that YugabyteDB Managed requires SSL.
- Alternatively, set up a standalone YugabyteDB cluster by following the steps in Install YugabyteDB.