1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sqlite: add sync and journal funcs, docs (#14970)

This commit is contained in:
CC
2022-07-06 12:01:27 -06:00
committed by GitHub
parent f0ce7fb9d3
commit d86b4951c7
2 changed files with 66 additions and 7 deletions

View File

@ -26,10 +26,11 @@ library installed on your system.
# Performance Tips
When performing a large amount of database calls (i.e. INSERTS), significant performance increase
can be obtained by issuing to sqlite the following pragma commands.
When performing a large amount of database calls (i.e. INSERTS), significant performance increase can be obtained by controlling the synchronization and journal modes.
```
db.exec('pragma synchronous = off;')
db.exec('pragma journal_mode = MEMORY;')
For instance,
```v
db := sqlite.connect('foo.db') or {panic(err)}
db.synchronization_mode(sqlite.SyncMode.off)
db.journal_mode(sqlite.JournalMode.memory)
```