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

Implement greptime: "-", ignore struct field #54

Open
adminpass opened this issue Nov 26, 2024 · 3 comments
Open

Implement greptime: "-", ignore struct field #54

adminpass opened this issue Nov 26, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@adminpass
Copy link

type Electric struct {
	ID       int64     `gorm:"id" greptime:"-"`
	DataTime time.Time `gorm:"data_time;primaryKey" greptime:"timestamp;column:data_time;type:timestamp;precision:second"`
	DeviceNo string    `gorm:"device_no;primaryKey" greptime:"tag;column:device_no;type:string"`
	Value    float32   `gorm:"value" greptime:"field;column:value;type:float32"`
}

use gorm to query data, ignore ID when writing to greptimedb

@daviderli614 daviderli614 self-assigned this Nov 26, 2024
@daviderli614
Copy link
Member

Do you want to ignore the fields marked with - when writing data? @adminpass

@adminpass
Copy link
Author

@daviderli614 yes, use greptime:"-"

@daviderli614
Copy link
Member

hello @adminpass
This feature has been supported in SDK version v0.6.0

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

No branches or pull requests

2 participants