https://github.com/gcclinux/gotestdb
Simple go program using postgreSQL
https://github.com/gcclinux/gotestdb
Last synced: 12 months ago
JSON representation
Simple go program using postgreSQL
- Host: GitHub
- URL: https://github.com/gcclinux/gotestdb
- Owner: gcclinux
- Created: 2022-12-21T14:29:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-27T16:18:30.000Z (about 3 years ago)
- Last Synced: 2025-01-22T23:44:18.769Z (about 1 year ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gotestdb
Simple go program using postgreSQL
1) Prerequisite installed or access to PostgreSQL
2) Prerequisite GO fully installed and working
3) notes/postgresql.txt show how to create test database
4) program structure
gotestdb --> main.go
gotestdb --> go.mod
gotestdb --> go.sum
gotestdb --> conf --> conf.json
gotestdb --> conn --> getconf.go
gotestdb --> conn --> db.go
gotestdb --> proc --> checkerror.go
gotestdb --> proc --> insertdata.go
gotestdb --> proc --> listdata.go
gotestdb --> proc --> readtest.go
5) donwload mods --> go mod tidy
6) run gotestdb --> go run main.go
```
package main
import "testdb/proc"
func main() {
// List available data
proc.ListData()
// Read data from database
proc.ReadTest()
// Upload data into database
upload()
}
func upload() {
proc.Insert("Cyndi", "Lauper", "69")
proc.Insert("Elvis", "Presley", "87")
proc.Insert("Bruce", "Springsteen", "73")
proc.Insert("Billy", "Idol", "67")
proc.Insert("Ozzy", "Osbourne", "74")
proc.Insert("Brandon", "Flowers", "41")
}
```
Output Example
