- 中文
- English
fuckdb
helps you fuck the db when you write go struct.
fuckdb
generates a go compatible struct type with the required column names, data types, and annotations just fill in the database information in the web UI. Making go web develop very easy by saving a lot of time writing structure.fuckdb
is based/inspired by the work of Seth Shelnutt's db2struct, and Db2Struct is based/inspired by the work of ChimeraCoder's gojson package gojson.
- Easy to use
Only a few clicks on the web UI can generate the corresponding golang struct with
ORM
orjson
orxm
... tags.
- git clone the source code
- cd fuckdb/
- cd frontend && npm run build
- go run main.go
- Use
localhost:8000
you will get the web UI - The same operation with docker deployment.
- modify your backend ip in
frontend/src/config/index.js
- docker-compose up -d
- Use
localhost:8000
you will get the next page - Just Put your mariaDB/mysql info into it and you will get your golang code.
- Click generate.
- Boom!Enjoy your coffee and copy your struct code.
- macos
brew tap hantmac/tap && brew install fuckdb
- Linux
curl https://github.com/hantmac/fuckdb/releases/download/v0.2/fuckdb_linux.tar.gz
-
windows download the windows file in release
-
First, run
fuckdb generate
to generatefuckdb.json
add your mysql info
{
"db": {
"host": "localhost",
"port": 3306,
"password": "password",
"user": "root",
"table": "cars",
"database": "example",
"packageName": "test",
"structName": "test",
"jsonAnnotation": true,
"gormAnnotation": true
}
}
- then run
fuckdb go
and get your code!
More info => 'Go_Official_Blog' on WeChat: