Skip to content

fix: gorm.GormDataTypeInterface => gorm.GormDBDataTypeInterface#305

Closed
zohu wants to merge 1 commit intodromara:masterfrom
zohu:master
Closed

fix: gorm.GormDataTypeInterface => gorm.GormDBDataTypeInterface#305
zohu wants to merge 1 commit intodromara:masterfrom
zohu:master

Conversation

@zohu
Copy link

@zohu zohu commented Jun 16, 2025

ERROR: type "datetime" does not exist

@kuafuRace
Copy link
Collaborator

kuafuRace commented Jun 17, 2025

I hope to keep the lightweight of carbon and not rely on third-party package. You can reimplement the interface through embedded types,such as

type DateTime struct {
    *carbon.Carbon
}
func (c *DateTime) GormDataType() string {
    //return "TIMESTAMP"
    //return "TEXT"
    return "DATETIME"
}

@zohu
Copy link
Author

zohu commented Jun 17, 2025

I hope to keep the lightweight of carbon and not rely on third-party package. You can reimplement the interface through embedded types,such as

type DateTime struct {
    *carbon.Carbon
}
func (c *DateTime) GormDataType() string {
    //return "TIMESTAMP"
    //return "TEXT"
    return "DATETIME"
}

I understand that this library is zero-dependency, so could you please avoid implementing GormDataType in the library? It may cause a panic if the GORM tag 'type' is not added.

@zohu
Copy link
Author

zohu commented Jun 17, 2025

keep this part consistent with v2.6.7?

@kuafuRace
Copy link
Collaborator

keep this part consistent with v2.6.7?保持此部分与v2.6.7一致?

Okay, next version will remove implementing GormDataType

@zohu zohu closed this Jun 17, 2025
@kuafuRace
Copy link
Collaborator

v2.6.9 has been released

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

Successfully merging this pull request may close these issues.

2 participants