summaryrefslogtreecommitdiffstats
path: root/lib/db/namespaced.go
AgeCommit message (Collapse)Author
2020-04-13cmd/syncthing, lib/db: Store upgrade info to throttle queries (fixes #6513) ↵v1.5.0-rc.1Simon Frei
(#6514)
2020-03-31lib/db, lib/model: Code simplifications (#6484)greatroar
NamespacedKV.prefixedKey is still small enough to be inlined.
2019-11-30all: Propagate errors from NamespacedKV (#6203)Jakob Borg
As foretold by the prophecy, "once the database refactor is merged, then shall appear a request to propagate errors from the store known throughout the land as the NamedspacedKV, and it shall be good".
2019-11-29Implement database abstraction, error checking (ref #5907) (#6107)Jakob Borg
This PR does two things, because one lead to the other: - Move the leveldb specific stuff into a small "backend" package that defines a backend interface and the leveldb implementation. This allows, potentially, in the future, switching the db implementation so another KV store should we wish to do so. - Add proper error handling all along the way. The db and backend packages are now errcheck clean. However, I drew the line at modifying the FileSet API in order to keep this manageable and not continue refactoring all of the rest of Syncthing. As such, the FileSet methods still panic on database errors, except for the "database is closed" error which is instead handled by silently returning as quickly as possible, with the assumption that we're anyway "on the way out".
2019-02-14lib/db: Flush batch based on size and refactor (fixes #5531) (#5536)Simon Frei
Flush the batch when exceeding a certain size, instead of when reaching a number of batched operations. Move batch to lowlevel to be able to use it in NamespacedKV. Increase the leveldb memory buffer from 4 to 16 MiB.
2019-02-02all: Revert the underscore sillynessJakob Borg
2019-02-02all: Bunch of more linter fixes (#5500)Jakob Borg
2019-02-01lib/db: Fix race in NamespacedKV (#5496)Simon Frei
2018-10-10lib/db: Refactor: use a Lowlevel type underneath Instance (ref #5198) (#5212)Jakob Borg
This adds a thin type that holds the state associated with the leveldb.DB, leaving the huge Instance type more or less stateless. Also moves some keying stuff into the DB package so that other packages need not know the keying specifics. (This does not, yet, fix the cmd/stindex program, in order to keep the diff size down. Hence the keying constants are still exported.)
2017-02-09all: Update license url to https (ref #3976)Jakob Borg
2015-10-31We should pass around db.Instance instead of leveldb.DBJakob Borg
We're going to need the db.Instance to keep some state, and for that to work we need the same one passed around everywhere. Hence this moves the leveldb-specific file opening stuff into the db package and exports the dbInstance type.
2015-08-09mv internal libJakob Borg