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:
@ -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)
|
||||
```
|
Reference in New Issue
Block a user