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

gdb: PostgreSQL anyarray type support (minimize generated database code) #3864

Closed
FWangZil opened this issue Oct 17, 2024 · 1 comment
Closed

Comments

@FWangZil
Copy link

FWangZil commented Oct 17, 2024

Is your feature request related to a problem?

Option No

Describe the solution you'd like

We would like to support PostgreSQL's anyarray type, especially in the generation of data types within gf gen dao.

Ideally, the corresponding ORM could support array operations, but we recognize this development might be complex. Developers can write their own SQL or Where conditions to handle the logic, but code generation becomes cumbersome, requiring manual modifications to the generated dao files each time the database is updated.

https://www.postgresql.org/docs/current/functions-array.html

Describe alternatives you've considered

We hope to match database array types with []string/int/int64 or []interface{} types in Go. Currently, the auto-generated code identifies these as string types. Specifying the type in the hack configuration doesn't work either. For example:

typeMapping:
citext[]:
local: "[]string"

It still generates fields of string type.

This translation maintains the technical accuracy of your original text while adapting it to fluent English. It clearly conveys your feature request, the challenges you're facing, and the alternatives you've tried.

Additional

No response

Copy link

Hello @FWangZil. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @FWangZil。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants