Improve database to golang name mapping.
This commit is contained in:
parent
3e7277015d
commit
950663dadb
19 changed files with 538 additions and 122 deletions
|
|
@ -2,7 +2,7 @@ package postgres_metadata
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/serenize/snaker"
|
||||
"github.com/go-jet/jet/internal/util"
|
||||
)
|
||||
|
||||
type TableInfo struct {
|
||||
|
|
@ -58,7 +58,7 @@ func (t TableInfo) GetImports() []string {
|
|||
}
|
||||
|
||||
func (t TableInfo) GoStructName() string {
|
||||
return snaker.SnakeToCamel(t.name) + "Table"
|
||||
return util.ToGoIdentifier(t.name) + "Table"
|
||||
}
|
||||
|
||||
func GetTableInfo(db *sql.DB, dbName, schemaName, tableName string) (tableInfo TableInfo, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue