From 5e7f4f4380494d7e4096465d6f9435f55e482516 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Mon, 15 Jul 2024 10:47:23 +0530 Subject: [PATCH] fix: update regex for primary key --- src/crud/utils.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/crud/utils.go b/src/crud/utils.go index 18b0c26..ce90381 100644 --- a/src/crud/utils.go +++ b/src/crud/utils.go @@ -3,16 +3,17 @@ package crud import ( "encoding/json" "fmt" - "github.com/sudoblockio/icon-transformer/config" - "github.com/sudoblockio/icon-transformer/metrics" - "go.uber.org/zap" - "golang.org/x/exp/slices" - "gorm.io/gorm/clause" "log" "reflect" "regexp" "strings" "time" + + "github.com/sudoblockio/icon-transformer/config" + "github.com/sudoblockio/icon-transformer/metrics" + "go.uber.org/zap" + "golang.org/x/exp/slices" + "gorm.io/gorm/clause" ) // getModelColumnNames - Get a slice of column names from a Model's tags @@ -60,7 +61,7 @@ func ToSnakeCase(str string) string { return strings.ToLower(snake) } -var matchPrimaryKey = regexp.MustCompile("primary_key") +var matchPrimaryKey = regexp.MustCompile("primaryKey") // getModelPrimaryKeys - Get a slice of primary keys from the ORM Model's tags func getModelPrimaryKeys[T any](model T) []clause.Column {