@@ -18,6 +18,7 @@ import (
18
18
"github.com/ncruces/go-sqlite3/vfs"
19
19
_ "github.com/ncruces/go-sqlite3/vfs/adiantum"
20
20
"github.com/ncruces/go-sqlite3/vfs/memdb"
21
+ "github.com/ncruces/go-sqlite3/vfs/mvcc"
21
22
_ "github.com/ncruces/go-sqlite3/vfs/xts"
22
23
)
23
24
@@ -98,6 +99,22 @@ func Test_memdb(t *testing.T) {
98
99
testIntegrity (t , name )
99
100
}
100
101
102
+ func Test_mvcc (t * testing.T ) {
103
+ var iter int
104
+ if testing .Short () {
105
+ iter = 1000
106
+ } else {
107
+ iter = 5000
108
+ }
109
+
110
+ mvcc .Create ("test.db" , "" )
111
+ name := "file:/test.db?vfs=mvcc" +
112
+ "&_pragma=busy_timeout(10000)"
113
+ createDB (t , name )
114
+ testParallel (t , name , iter )
115
+ testIntegrity (t , name )
116
+ }
117
+
101
118
func Test_adiantum (t * testing.T ) {
102
119
if ! vfs .SupportsFileLocking {
103
120
t .Skip ("skipping without locks" )
@@ -312,6 +329,16 @@ func Benchmark_memdb(b *testing.B) {
312
329
testParallel (b , name , b .N )
313
330
}
314
331
332
+ func Benchmark_mvcc (b * testing.B ) {
333
+ mvcc .Create ("test.db" , "" )
334
+ name := "file:/test.db?vfs=mvcc" +
335
+ "&_pragma=busy_timeout(10000)"
336
+ createDB (b , name )
337
+
338
+ b .ResetTimer ()
339
+ testParallel (b , name , b .N )
340
+ }
341
+
315
342
func createDB (t testing.TB , name string ) {
316
343
db , err := sqlite3 .Open (name )
317
344
if err != nil {
0 commit comments