Comments (4)
Please share a complete reproducible example, including which version of this library you are using.
from go-sqlite3.
FWIW, I use this functionality heavily in rqlite, and I get non-zero values back for the scan. In other words, it seems to work fine for me.
- https://github.com/rqlite/rqlite/blob/master/db/db.go#L368
- https://github.com/rqlite/rqlite/blob/master/db/db.go#L398
Here is me running a hacked up unit test from rqlite:
$ git diff
diff --git a/db/db.go b/db/db.go
index 6135ff90..75fc0b96 100644
--- a/db/db.go
+++ b/db/db.go
@@ -398,6 +398,7 @@ func (db *DB) CheckpointWithTimeout(mode CheckpointMode, dur time.Duration) (err
if err := db.rwDB.QueryRow(checkpointPRAGMAs[mode]).Scan(&ok, &nPages, &nMoved); err != nil {
return fmt.Errorf("error checkpointing WAL: %s", err.Error())
}
+ fmt.Println("checkpointed", nPages, "pages", nMoved, "moved")
stats.Add(numCheckpointedPages, int64(nPages))
stats.Add(numCheckpointedMoves, int64(nMoved))
if ok != 0 {
$ go test -run Test_DBSums
checkpointed 3 pages 3 moved
PASS
ok github.com/rqlite/rqlite/v8/db 0.048s
~/repos/rqlite/src/github.com/rqlite/rqlite/db (master)$
from go-sqlite3.
Nevermind, I could not reproduce in an isolated environment. My theory is that SQLite is doing an automatic checkpoint already once all the inflight transactions are finished. That is why the manual checkpoint returns all zeroes.
from go-sqlite3.
Easy enough to validate, disable automatic checkpoints as rqlite does.
from go-sqlite3.
Related Issues (20)
- Database file does not get created when using connection string HOT 4
- importing go-sqlite hangs my application!!?? HOT 3
- Inconsistent parsing of DATETIME type, causing errors HOT 7
- C code errors on linux amd64
- exec for update does not correctly return sql.Results HOT 1
- Can't seem to fuzz SQLite?? HOT 1
- sqlite3 in-memory mode deletes data and releases memory
- x86编译问题
- It doesn't create a new database file if opened in a `network drive` with `:encrypted.db?_key`.
- Flagged by Windows Defender since v1.14.20 HOT 2
- Race conditions during unit tests despite workarounds HOT 2
- Is it worth compiling in math functions by default? HOT 3
- Inconsistent behavior of sin() math function on x86 (musl / alpine)
- High suspended process count on linux
- Segmentation fault in Ubuntu 18.04 with GLIBC_2.34 HOT 1
- 【ERROR】Windows use winlibs HOT 1
- Panic while using sqlite rows.Next() - fatal error: unexpected signal during runtime execution
- sqlite3-binding.c use after free HOT 4
- Generic PRAGMA URI parameters HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sqlite3.