mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
34 lines
438 B
V
34 lines
438 B
V
![]() |
import db.sqlite
|
||
|
|
||
|
[table: 'bad_table']
|
||
|
struct Bad {
|
||
|
id int [primary; sql: serial]
|
||
|
link string
|
||
|
}
|
||
|
|
||
|
fn test_insert_with_reserved_name() {
|
||
|
db := sqlite.connect(':memory:') or { panic(err) }
|
||
|
|
||
|
bad := Bad{
|
||
|
link: 'test'
|
||
|
}
|
||
|
sql db {
|
||
|
create table Bad
|
||
|
}
|
||
|
sql db {
|
||
|
insert bad into Bad
|
||
|
}
|
||
|
|
||
|
sql db {
|
||
|
insert bad into Bad
|
||
|
insert bad into Bad
|
||
|
insert bad into Bad
|
||
|
}
|
||
|
|
||
|
rows := sql db {
|
||
|
select from Bad
|
||
|
}
|
||
|
|
||
|
assert rows.len == 4
|
||
|
}
|