go-xorm / cmd

Command line tools for database operation written by Go, moved to https://gitea.com/xorm/cmd
BSD 3-Clause "New" or "Revised" License
168 stars 77 forks source link

[Error] reverse.go:172 sql: unknown driver "sqlite3" (forgotten import?) #32

Closed mycode65678 closed 6 years ago

mycode65678 commented 6 years ago

devdeMacBook-Pro:autoBet dev$ xorm reverse sqlite3 ./autoBetDb.db /Users/dev/go/src/github.com/go-xorm/cmd/xorm/templates/goxorm 2018/03/27 16:51:12 [Error] reverse.go:172 sql: unknown driver "sqlite3" (forgotten import?)

ziqiangcheng commented 6 years ago

you need to "go build -tags sqlite3" to build "xorm" first.

  1. cd to %GOPATH%/src/github.com/go-xorm/cmd/xorm
  2. run "go build -tags sqlite3"
  3. a new "xorm" will be generated at current dir
  4. copy the new "xorm" to %GOPATH%/bin
  5. run your "xorm reverse ..." again. Done!