Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 708 Bytes

README.md

File metadata and controls

24 lines (19 loc) · 708 Bytes

pginit

Golang package that will create a database (if the database does not exist), create a user with a given password (if the user does not exists), and consequently grants all permissions to the user on that database.

Usage

  1. Ulogger needs to be setup. It needs to be created and passed as
pginit.Init(appName, orgName, production) // appName and orgName are strings. production is bool.
  1. Create the database
pginit.CreateDB(dbName)
  1. Create the user
pginit.CreateUser("userA", "passwd", dbName)
  1. Check if PostgreSQL server is live
dbStatus := CheckIfDBIsLive() // returns a bool mentioning if the DB server is live