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

Document ORM API #18

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Document ORM API #18

wants to merge 12 commits into from

Conversation

adzialocha
Copy link
Member

@adzialocha adzialocha commented Feb 28, 2023

ORM-style document API:

const keyPair = new KeyPair();
const session = new Session(ENDPOINT).setKeyPair(keyPair);

const Chat = session.addSchema(SCHEMA_ID);

const message = await Chat.create({
  message: '1',
});

await message.update({
  message: '2',
});

await message.update({
  message: '3',
});

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@adzialocha adzialocha changed the title Document orm Document ORM API Feb 28, 2023
This was linked to issues Feb 28, 2023
@sandreae
Copy link
Member

LOVE this 😍

* main: (23 commits)
  0.1.0
  Update package-lock.json
  Add RELEASE.md
  Build step is not required
  Remove name
  Only deploy on push to main
  Update NodeJS version, fix cache paths
  Move deploy task to js workflow file
  Run deploy ci from any branch for now
  Deploy docs to github pages
  Remove browser examples
  Mention types in package.json
  Add entry to CHANGELOG.md
  Copy wasm file into build folder
  Write more about wasm import
  Remove custom doc strings, they don't work
  Try to overwrite documentation from p2panda-js
  Use exports field instead of main in package.json
  Set minimum NodeJS version back to 16
  Remove testing v14, add 17 and 19 instead
  ...
@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Patch coverage: 24.02% and project coverage change: -44.23 ⚠️

Comparison is base (200adb7) 93.69% compared to head (4cecff2) 49.46%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #18       +/-   ##
===========================================
- Coverage   93.69%   49.46%   -44.23%     
===========================================
  Files           5       10        +5     
  Lines         111      283      +172     
  Branches       19       39       +20     
===========================================
+ Hits          104      140       +36     
- Misses          7      141      +134     
- Partials        0        2        +2     
Impacted Files Coverage Δ
src/document.ts 5.40% <5.40%> (ø)
src/schema.ts 6.81% <6.81%> (ø)
src/collection.ts 14.28% <14.28%> (ø)
src/utils.ts 22.22% <22.22%> (ø)
src/cache.ts 81.81% <81.81%> (ø)
src/session.ts 92.04% <84.00%> (-3.61%) ⬇️
src/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Introduce ORM API with documents Cache next entry arguments
2 participants