An open API service indexing awesome lists of open source software.

https://github.com/starfishs/sql2struct

sql2struct is a tool for sql statement to golang struct
https://github.com/starfishs/sql2struct

go golang gorm model mysql postgresql sql sql2struct struct tool xorm

Last synced: 2 months ago
JSON representation

sql2struct is a tool for sql statement to golang struct

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/starfishs/sql2struct.svg?branch=main)](https://travis-ci.org/starfishs/sql2struct)
[![Go Report Card](https://goreportcard.com/badge/github.com/starfishs/sql2struct)](https://goreportcard.com/report/github.com/starfishs/sql2struct)
[![GoDoc](https://godoc.org/github.com/starfishs/sql2struct?status.svg)](https://godoc.org/github.com/starfishs/sql2struct)
[![codecov](https://codecov.io/gh/starfishs/sql2struct/branch/main/graph/badge.svg)](https://codecov.io/gh/starfishs/sql2struct)
![License](https://img.shields.io/badge/license-GPL-blue.svg)
# sql2struct
mysql/postgresql database to golang struct for gorm model

# install
```shell
go install github.com/starfishs/sql2struct@latest
```

# usage
```shell
sql2struct --dsn="mysql://root:123456@tcp(localhost:3306)/test?charset=utf8mb4"
```
# docker
```shell
docker run -v /path/to/store:/workspace -w /workspace starfishsfive/sql2struct:v1.0.0 --dsn="postgresql://root:123456@localhost:5432/test?sslmode=disable"
```

# support
- [x] mysql
- [x] postgreSQL

## Contributors



starfishs


Starfish




Siqitango


Null




miajio


Snaro Chris Xiao




calabashbrother


Null