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

CreateInBatches Error #196

Closed
aixj1984 opened this issue Oct 10, 2024 · 2 comments
Closed

CreateInBatches Error #196

aixj1984 opened this issue Oct 10, 2024 · 2 comments
Assignees

Comments

@aixj1984
Copy link

aixj1984 commented Oct 10, 2024

GORM Playground Link

go-gorm/playground#1

Description

	type TestModel struct {
		LogID     int64     `gorm:"column:log_id;primaryKey;type:UInt64"  json:"logID"`
		CreatedAt time.Time `json:"createdAt"`
		UpdatedAt time.Time `json:"updatedAt"`
	}
       var arr []*TestModel
	for i := 0; i < 10; i++ {
		newObj := &TestModel{
			CreatedAt: time.Now(),
			UpdatedAt: time.Now(),
			LogID:     int64(i),
		}
		arr = append(arr, newObj)
	}

	db.CreateInBatches(arr, 10000)

Error Msg : clickhouse [AppendRow]: converting clause.Expr to UInt64 is unsupported

@aixj1984
Copy link
Author

log_id clickhouse [AppendRow]: converting clause.Expr to UInt64 is unsupported
[16.795ms] [rows:0] INSERT INTO test_models (created_at,updated_at,log_id) VALUES ('2024-10-10 11:21:18.341','2024-10-10 11:21:18.341',DEFAULT)

@aixj1984
Copy link
Author

因为primaryKey导致的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants