mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
orm,sqlite,mysql,pg: cleanup import v.ast
, using typeof[Type]()
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import orm
|
||||
import mysql
|
||||
import time
|
||||
import v.ast
|
||||
|
||||
struct TestCustomSqlType {
|
||||
id int [primary; sql: serial]
|
||||
@ -51,7 +50,7 @@ fn test_mysql_orm() {
|
||||
db.create('Test', [
|
||||
orm.TableField{
|
||||
name: 'id'
|
||||
typ: ast.int_type_idx
|
||||
typ: typeof[int]().idx
|
||||
attrs: [
|
||||
StructAttribute{
|
||||
name: 'primary'
|
||||
@ -66,12 +65,12 @@ fn test_mysql_orm() {
|
||||
},
|
||||
orm.TableField{
|
||||
name: 'name'
|
||||
typ: ast.string_type_idx
|
||||
typ: typeof[string]().idx
|
||||
attrs: []
|
||||
},
|
||||
orm.TableField{
|
||||
name: 'age'
|
||||
typ: ast.int_type_idx
|
||||
typ: typeof[int]().idx
|
||||
},
|
||||
]) or { panic(err) }
|
||||
|
||||
@ -84,11 +83,11 @@ fn test_mysql_orm() {
|
||||
table: 'Test'
|
||||
has_where: true
|
||||
fields: ['id', 'name', 'age']
|
||||
types: [ast.int_type_idx, ast.string_type_idx, ast.i64_type_idx]
|
||||
types: [typeof[int]().idx, typeof[string]().idx, typeof[i64]().idx]
|
||||
}, orm.QueryData{}, orm.QueryData{
|
||||
fields: ['name', 'age']
|
||||
data: [orm.Primitive('Louis'), i64(101)]
|
||||
types: [ast.string_type_idx, ast.i64_type_idx]
|
||||
types: [typeof[string]().idx, typeof[i64]().idx]
|
||||
is_and: [true, true]
|
||||
kinds: [.eq, .eq]
|
||||
}) or { panic(err) }
|
||||
|
Reference in New Issue
Block a user