Difference between revisions of "Gen"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with " https://github.com/smallnest/gen/issues/140 GO111MODULE=off")
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
https://github.com/smallnest/gen/issues/140
 
https://github.com/smallnest/gen/issues/140
  
GO111MODULE=off
+
```
 +
GO111MODULE=off go get  github.com/gogo/protobuf/proto
 +
```
 +
 
 +
 
 +
```
 +
export GOPATH=/root/go
 +
PATH=$PATH:~/go/bin
 +
snap install go
 +
apt install make gcc
 +
wget https://github.com/smallnest/gen/raw/master/example/sample.db
 +
go get -u github.com/smallnest/gen
 +
gen --sqltype=sqlite3 \
 +
  --connstr "./sample.db" \
 +
  --database main  \
 +
  --json \
 +
  --gorm \
 +
  --guregu \
 +
  --rest \
 +
  --out ./example \
 +
  --module example.com/rest/example \
 +
  --mod \
 +
  --server \
 +
  --makefile \
 +
  --json-fmt=snake \
 +
  --generate-dao \
 +
  --generate-proj \
 +
  --overwrite
 +
cd example
 +
make example
 +
```

Latest revision as of 20:07, 4 May 2023

https://github.com/smallnest/gen/issues/140

GO111MODULE=off go get  github.com/gogo/protobuf/proto
export GOPATH=/root/go
PATH=$PATH:~/go/bin
snap install go
apt install make gcc
wget https://github.com/smallnest/gen/raw/master/example/sample.db
go get -u github.com/smallnest/gen
gen --sqltype=sqlite3 \
    --connstr "./sample.db" \
    --database main  \
    --json \
    --gorm \
    --guregu \
    --rest \
    --out ./example \
    --module example.com/rest/example \
    --mod \
    --server \
    --makefile \
    --json-fmt=snake \
    --generate-dao \
    --generate-proj \
    --overwrite
cd example
make example