xorm/mysql_test.go

47 lines
812 B
Go
Raw Normal View History

2013-06-08 04:41:51 +00:00
package xorm
import (
_ "github.com/go-sql-driver/mysql"
"testing"
)
var me Engine
2013-06-21 04:39:01 +00:00
/*
CREATE DATABASE IF NOT EXISTS orm_test CHARACTER SET
utf8 COLLATE utf8_general_ci;
*/
2013-06-08 04:41:51 +00:00
func TestMysql(t *testing.T) {
// You should drop all tables before executing this testing
me = Create("mysql", "root:123@/test?charset=utf8")
2013-06-08 04:41:51 +00:00
me.ShowSQL = true
directCreateTable(&me, t)
mapper(&me, t)
insert(&me, t)
query(&me, t)
exec(&me, t)
insertAutoIncr(&me, t)
insertMulti(&me, t)
insertTwoTable(&me, t)
update(&me, t)
testdelete(&me, t)
get(&me, t)
cascadeGet(&me, t)
find(&me, t)
findMap(&me, t)
count(&me, t)
where(&me, t)
in(&me, t)
limit(&me, t)
order(&me, t)
join(&me, t)
having(&me, t)
transaction(&me, t)
combineTransaction(&me, t)
table(&me, t)
createMultiTables(&me, t)
tableOp(&me, t)
}