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 option to pass ignoreOwnership during entity creation #457

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xamogh
Copy link

@xamogh xamogh commented Dec 25, 2024

We are migrating our codebase to use electrodb. Devs sometimes forget to include this flag and it fails silently because types are not narrowed down from the flags passed inside the .go({...}). It will be convenient if there was an option to pass in ignoreOwnership when creating entities so that errors are minimized. Example:

const entity = new Entity(..., {table: ..., ignoreOwnership: true})

so that it is applied to all .go({// no need to pass ignoreOwnership explicitly here for all queries})

Default will always be false so there will be no issues unless explicitly added in the entity.

Copy link

netlify bot commented Dec 25, 2024

Deploy Preview for electrodb-dev canceled.

Name Link
🔨 Latest commit 15a3721
🔍 Latest deploy log https://app.netlify.com/sites/electrodb-dev/deploys/676d5ad15db15e0008874356

@tywalch
Copy link
Owner

tywalch commented Dec 28, 2024

Thanks @xamogh! This should work, but would you mind adding a few unit tests to your PR?

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.

2 participants