Skip to content

betterstack-community/go-database-access

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Work with SQL Databases in Go

Demo repository for article on SQL database access in Go.

🟢 Prerequisites

  • The latest version of Go and PostgreSQL installed

📦 Getting started

Clone the repository:

git clone https://github.com/betterstack-community/go-database-access.git
cd go-database-access/

Build the project:

go build

Rename .env.example to .env and modify the PostgreSQL connection string as needed.

Create a new database through the psql console named "gda".

Populate the gda database:

./gda setup

Run code examples:

./gda example [connect|single|multi|parameterised|null|insert|transaction|struct|return|prepared|conn|timeout]

⚖ License

The code used in this project and in the linked tutorial are licensed under the Apache License, Version 2.0.

About

Demo repository for article on SQL database access in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.4%
  • Shell 0.6%