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

Dependency Updates #1

Merged
merged 3 commits into from
Nov 12, 2023
Merged

Dependency Updates #1

merged 3 commits into from
Nov 12, 2023

Conversation

farskipper
Copy link
Member

@farskipper farskipper commented Nov 12, 2023

Breaking change on how the database is setup.

Before: Optional provide a leveldown, and by default would use memdown.
After: Must provide an abstract-level implementation that matches the type signature of PicoDb.

For example, creating an in-memory db:

import { MemoryLevel } from "memory-level";
import { PicoFramework, PicoDb, PicoDbKey, RulesetLoader } from "pico-framework";
const charwise = require("charwise");
const safeJsonCodec = require("level-json-coerce-null");

const db: PicoDb = new MemoryLevel<PicoDbKey, any>({
  keyEncoding: charwise,
  valueEncoding: safeJsonCodec,
});

const rulesetLoader: RulesetLoader = ...

const pf = new PicoFramework({ db, rulesetLoader })
await pf.start()

@farskipper farskipper merged commit 6d702b0 into master Nov 12, 2023
12 checks passed
@farskipper farskipper deleted the dependency-updates branch November 12, 2023 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant