Coder Social home page Coder Social logo

gotestdb's Introduction

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

alt text

gotestdb's People

Contributors

gcclinux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.