-
Notifications
You must be signed in to change notification settings - Fork 263
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
DB #846
Comments
@Re-Wi 发下数据库吧,这个看起来是 gen 生成 model 的时候报错了 cc @chaoranz758 |
sqlite_sequence 和 sqlite_master 是 sqlite 的系统表,感觉本不应该被生成出来,这个问题应该算是 gen 本身的一个问题。 |
就是随便建了一个sqlite数据库测试,建数据库的工具是:db browser for sqlite
| |
***@***.***
|
|
***@***.***
|
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2023年10月29日 18:25 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [cloudwego/cloudwego.github.io] DB (Issue #846) |
@Re-Wi 发下数据库吧,这个看起来是 gen 生成 model 的时候报错了 cc @chaoranz758
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
看起来是的 |
type 后面需要指定字段对应的数据库字段类型,在 type 后面补上类型或者删掉 type 应该都不会报错,这个问题与 cwgo 侧无关 |
gen没有提供exclude的相关方法,但是提供了匹配的自定义方法 https://github.com/go-gorm/gen/blob/f53462308098236f5c5d29117e37f1c7580a7e2a/config.go#L82 |
此命令
cwgo model --db_type sqlite --dsn database.db
生成的的代码为:
运行代码报错:
去掉这里的两个
type:
,就可以成功运行了The text was updated successfully, but these errors were encountered: