support placeholder params > 65535 for postgres. #1687
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1687
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
for postgres driver only support placeholder arguments max value is 65535,
see here https://github.com/lib/pq/blob/master/conn.go#L1291
We can do some work in
insertMulti
method by steps .this is useful when our params's length is bigger than 65535, or users will implement this method in their business code, which will be less useful.
but I only implement this for postgres. I don't know if other drivers have the same issue, so if you have good way to solve this will be much better.
Thanks.
WIP: support placeholder params > 65535 for postgres.to support placeholder params > 65535 for postgres.Users should do that themselves.
@lunny Thanks for reply, I think if we can provide a method to do this will be better.
If we want to insert 50000 records and each record have 20 fields, we will have 10,000 placeholder params, it's not working when we using
insertMulti
method, and in fact, when users usinginsertMulti
method they even don't know the real sql executed, but we throw an error with the driver,If we implement this in business code, it's coupling with databases, we need to implement this for different database, but lost the meaning of using orm.
If we can provide a method and don't do this in
insertMulti
method, will save much work, in my project many places will inert multi records with more that 65536 params (it's an async job)what do you say?
@lunny And if the package don't provide the method I had to change to source code todo this, which is terrible for me. I'll lose the updating. 😢
Close per above comment.
Pull request closed