Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: URL and Installation #21

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ brews:
nfpms:
- id: dgw-nfpms
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}"
homepage: https://github.com/achiku/dgw
homepage: https://github.com/kanmu/dgw
maintainer: Akira Chiku <akira.chiku@gmail.com>
description: dgw generates Golang struct, and simple Table/Row Data Gateway functions from PostgreSQL table metadata
license: MIT
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# dgw

[![test](https://github.com/achiku/dgw/actions/workflows/test.yml/badge.svg)](https://github.com/achiku/dgw/actions/workflows/test.yml)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/achiku/dgw/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/achiku/dgw)](https://goreportcard.com/report/github.com/achiku/dgw)
[![test](https://github.com/kanmu/dgw/actions/workflows/test.yml/badge.svg)](https://github.com/kanmu/dgw/actions/workflows/test.yml)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/kanmu/dgw/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/kanmu/dgw)](https://goreportcard.com/report/github.com/kanmu/dgw)

## Description

Expand All @@ -11,7 +11,7 @@

## Why created

Personally, I prefer Table/Row Data Gateway over ORM/Query Builder approach when using Go with RDBMS. However, it is very time consuming, tedious, and error-prone to write a lot of columns, query place holders, and struct fields that all have to be exactly in order even for a simple select/insert statement. `dgw` generate Go struct, and simple functions to get/create row from PostgreSQL table definitions to avoid manually writing simple but tedious SQL.
Personally, I prefer Table/Row Data Gateway over ORM/Query Builder approach when using Go with RDBMS. However, it is very time consuming, tedious, and error-prone to write a lot of columns, query place holders, and struct fields that all have to be exactly in order even for a simple select/insert statement. `dgw` generate Go struct, and simple functions to get/create row from PostgreSQL table definitions to avoid manually writing simple but tedious SQL.

- `dgw` can properly detect autogenerated column (e.g. serial, bigserial), and composit primary key to create appropriate SQL.
- `dgw` has ability to easily customize PostgreSQL column type <-> Go type mapping using toml config file.
Expand All @@ -20,7 +20,7 @@ Personally, I prefer Table/Row Data Gateway over ORM/Query Builder approach when
## Installation

```
go get -u github.com/achiku/dgw
brew install kanmu/tools/dgw
```


Expand All @@ -44,12 +44,12 @@ Args:
```

```
dgw postgres://dbuser@localhost/dbname?sslmode=disable
dgw postgres://dbuser@localhost/dbname?sslmode=disable
```

## Example

- https://github.com/achiku/dgw/tree/master/example
- https://github.com/kanmu/dgw/tree/master/example

```sql
CREATE TABLE t1 (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/achiku/dgw
module github.com/kanmu/dgw

go 1.15

Expand Down