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

gorm v1.25.6 : Create error when using map[string]interface{} with Postgres #6812

Closed
magellancl opened this issue Jan 30, 2024 · 2 comments
Closed
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@magellancl
Copy link

GORM Playground Link

go-gorm/playground#685

Description

Related to go-gormigrate/gormigrate#217

This library is using customizable table and column name, so Create is used this way :

	columnName := "name"
	user := map[string]interface{}{columnName: "id"}
	err := DB.Table("users").Create(user).Error

which return the error "LastInsertId is not supported by this driver", instead of creating the record

@oxyno-zeta
Copy link

If this won't be patched, do you have a solution in order to patch the library?

@thesiti92
Copy link

this error is preventing me from upgrading my service! any help would be greatly appreciated

@jinzhu jinzhu closed this as completed in 81536f8 Mar 19, 2024
snackmgmg added a commit to snackmgmg/gorm that referenced this issue Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

4 participants