xorm/dialects/table_name_test.go
Nicolas Chiappero 5f3bad1949 [dialects/mssql.go] bugfix SQLType / GetColumns / GetTables / GetIndexes
[dialects/postgres.go] bugfix SQLType
[engine.go] use github.com/alexbrainman/odbc for odbc - bugfix objectId - add log - bugfix null value - bugfix sql server identity
[schemas/index.go] bugfix index name generatin
[schemas/table.go] add ObjectId field
[schemas/type.go] add DateTime2 type
[*] replace module xorm.io/xorm by gitea.com/nikos06/xorm
2021-03-19 12:10:55 +01:00

31 lines
707 B
Go

// Copyright 2018 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dialects
import (
"testing"
"gitea.com/nikos06/xorm/names"
"github.com/stretchr/testify/assert"
)
type MCC struct {
ID int64 `xorm:"pk 'id'"`
Code string `xorm:"'code'"`
Description string `xorm:"'description'"`
}
func (mcc *MCC) TableName() string {
return "mcc"
}
func TestFullTableName(t *testing.T) {
dialect := QueryDialect("mysql")
assert.EqualValues(t, "mcc", FullTableName(dialect, names.SnakeMapper{}, &MCC{}))
assert.EqualValues(t, "mcc", FullTableName(dialect, names.SnakeMapper{}, "mcc"))
}