| 1234567891011121314151617181920212223242526272829303132333435 |
- package dpsapi
- import (
- uuid "github.com/satori/go.uuid"
- "strings"
- )
- const (
- parseSqlInsert = `insert into students (id, name, age, rate, time, is_right) values ('aaa', 'yjp', 5, 92.5, parse_time('2024-01-01 00:00:00', '2006-01-02 15:04:05'), false)`
- parseSqlDelete = `delete from students where id = 'aaa' AND name = 'yjp' AND age < 100 AND describe IN ('yjp')`
- )
- const (
- sqlInsertFormat = `insert into %s (id, name, time, table_num) values ('%s', '%s', parse_time('%s', '2006-01-02 15:04:05'), %d)`
- )
- const (
- dpsAddress = "localhost:30170"
- testDatabaseID = "ee2d7dabe56646ce835d80873348ee0e"
- )
- var tableModelDescribe = map[string]string{
- "ID": "gorm:\"primary_key;type:varchar(32);comment:id;\"",
- "Name": "gorm:\"not null;type:varchar(128);comment:数据库名称;\"",
- "Time": "gorm:\"not null;type:timestamp with time zone;comment:数据库时间;\"",
- "TableNum": "gorm:\"not null;type:integer;comment:数据库表数量;\"",
- }
- func getUUID() string {
- return uuid.NewV4().String()
- }
- func simpleUUID() string {
- return strings.ReplaceAll(getUUID(), "-", "")
- }
|