Giter Club home page Giter Club logo

Comments (4)

rittneje avatar rittneje commented on June 12, 2024

Please share a complete reproducible example, including which version of this library you are using.

from go-sqlite3.

otoolep avatar otoolep commented on June 12, 2024

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.

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.

CyrusJavan avatar CyrusJavan commented on June 12, 2024

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.

otoolep avatar otoolep commented on June 12, 2024

Easy enough to validate, disable automatic checkpoints as rqlite does.

from go-sqlite3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.