From 42fdd9f829213043298c8e14ea49a89282c004cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20K=C3=B6ken?= Date: Sun, 24 Jan 2021 01:46:06 +0300 Subject: [PATCH 1/2] Update README.md --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 10e1f3f..12f4b32 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # gdbc-postgresql -GDBC Postgresql Driver +GDBC Postgresql Driver - It is based on [https://github.com/jackc/pgx](https://github.com/jackc/pgx) + +# Usage +```go +dataSource, err := gdbc.GetDataSource("gdbc:postgresql://username:password@localhost:3000/testdb?sslmode=disable") +if err != nil { + panic(err) +} + +var connection *sql.DB +connection, err = dataSource.GetConnection() +if err != nil { + panic(err) +} +``` + +Postgresql GDBC URL takes one of the following forms: + +``` +gdbc:postgresql://host:port/database-name?arg1=value1 +gdbc:postgresql://host/database-name?arg1=value1 +gdbc:postgresql:database-name?arg1=value1 +gdbc:postgresql:?arg1=value1 +gdbc:postgresql://username:password@host:port/database-name?arg1=value1 +``` + +Default Values: +* **Host** : localhost +* **Port** : 5432 +* **User** : postgres +* **Password** : + +Checkout [https://github.com/jackc/pgx](https://github.com/jackc/pgx) for arguments details. From b8b22665184253a6a41bf48f02ea78658174bbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20K=C3=B6ken?= Date: Sun, 24 Jan 2021 01:49:30 +0300 Subject: [PATCH 2/2] Added the badges --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 12f4b32..72d0657 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # gdbc-postgresql GDBC Postgresql Driver - It is based on [https://github.com/jackc/pgx](https://github.com/jackc/pgx) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-gdbc/gdbc-postgresql)](https://goreportcard.com/report/github.com/go-gdbc/gdbc-postgresql) +[![codecov](https://codecov.io/gh/go-gdbc/gdbc-postgresql/branch/main/graph/badge.svg?token=AsVeTnBKU1)](https://codecov.io/gh/go-gdbc/gdbc-postgresql) +[![Build Status](https://travis-ci.com/go-gdbc/gdbc-postgresql.svg?branch=main)](https://travis-ci.com/go-gdbc/gdbc-postgresql) + # Usage ```go dataSource, err := gdbc.GetDataSource("gdbc:postgresql://username:password@localhost:3000/testdb?sslmode=disable")