Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a basic content db for portal networks #848

Merged
merged 4 commits into from
Sep 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Avoid probably some form of sandwich problem by re-exporting kvstore_…
…sqlite3
  • Loading branch information
kdeme committed Sep 28, 2021
commit 2f3663ad325dcdb74f0f42561f354aebaa14792e
6 changes: 2 additions & 4 deletions fluffy/content_db.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import
stint,
./network/state/state_content

export kvstore_sqlite3

# This version of content db is the most basic, simple solution where data is
# stored no matter what content type or content network in the same kvstore with
# the content id as key. The content id is derived from the content key, and the
Expand Down Expand Up @@ -46,10 +48,6 @@ proc new*(T: type ContentDB, path: string, inMemory = false): ContentDB =

ContentDB(kv: kvStore db.openKvStore().expectDb())

proc huh(path: string) =
let db = SqStoreRef.init(path, "fluffy").expectDb()
discard ContentDB(kv: kvStore db.openKvStore().expectDb())

proc get*(db: ContentDB, key: openArray[byte]): Option[seq[byte]] =
var res: Option[seq[byte]]
proc onData(data: openArray[byte]) = res = some(@data)
Expand Down