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

\contrib\drivers\pgsql\v2: pgsql will report an error when inserting the data if it is an array. #3632

Closed
jinmao88 opened this issue Jun 5, 2024 · 3 comments · Fixed by #3645
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@jinmao88
Copy link
Contributor

jinmao88 commented Jun 5, 2024

Go version

go .122

GoFrame version

2.7.1

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

插入的数据 如果字段类型是数组类型,[]int 这种 会报错

What did you see happen?

3475dfcd6901575174cc122f9b304334
0f8d50323088b4f7e8594b5629de41b2
cf6fb9a61f20da9f73291565f07abdf2

pgsql驱动内的函数 入参是NAME 无法触发switch 进行转换

What did you expect to see?

希望能正常写入

@jinmao88 jinmao88 added the bug It is confirmed a bug, but don't worry, we'll handle it. label Jun 5, 2024
@Issues-translate-bot Issues-translate-bot changed the title \contrib\drivers\pgsql\v2:pgsql 在insert的时候 数据如果是array 会报错 \contrib\drivers\pgsql\v2: pgsql will report an error when inserting the data if it is an array. Jun 5, 2024
@oldme-git
Copy link
Member

请提供最小代码实现

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Please provide minimum code implementation

@jinmao88
Copy link
Contributor Author

jinmao88 commented Jun 7, 2024

type Member struct {
Id int json:"id" orm:"id" //
Income []int json:"income" orm:"income" // 月收入

}

func (r *Req) Add() error {
m := dao.Member.Ctx(r.Ctx).Data(&Member{Income: []int{1, 1}})
m.Insert()
return nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants