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

generated struct has no fields #30

Closed
2030405043 opened this issue Dec 17, 2019 · 8 comments
Closed

generated struct has no fields #30

2030405043 opened this issue Dec 17, 2019 · 8 comments

Comments

@2030405043
Copy link

2030405043 commented Dec 17, 2019

`package model

import (
"database/sql"
"time"
"github.com/guregu/null"
)

var (
_ = time.Second
_ = sql.LevelDefault
_ = null.Bool{}
)

type UserAliinfo struct {
}

// TableName sets the insert table name for this struct type
func (u *UserAliinfo) TableName() string {
return "user_aliinfo"
}
`

@smallnest
Copy link
Owner

see #25 : mysql 8 issue
see #19 : update golang and deps

@2030405043
Copy link
Author

mysql 5.7
golang:1.13 windows

@gatspy
Copy link

gatspy commented Dec 18, 2019

Have the same problem.

mysql: 5.7
go: 1.13 mac osx

@smallnest
Copy link
Owner

go get -u -v github.com/jimsmart/schema 试试,应该是这个库没有读取出表的 schema

@MaxJohnXiang
Copy link

I has the same problem ,
mysql: 5.7
go: 1.13 mac osx

---mysql version info
innodb_version 5.7.21
protocol_version 10
slave_type_conversions
tls_version TLSv1,TLSv1.1,TLSv1.2
version 5.7.21
version_comment Homebrew
version_compile_machine x86_64
version_compile_os osx10.13

  1. Already update go dep
  2. Already install schema

@smallnest
Copy link
Owner

最好把你的表信息贴上来以便debug,或者你自己看看schema为什么没能获取出数据库的元数据

@smallnest
Copy link
Owner

see #28, 看看是否是同一个问题,更新一下gen试试

@alexj212
Copy link
Collaborator

alexj212 commented May 1, 2020

Can you provide the table ddl from a db dump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants