Skip to content

refactor: use batching for SHACL/Flow link operations#685

Merged
lucksus merged 1 commit intofeat/shacl-sdna-migrationfrom
fix/shacl-batching-and-imports
Feb 19, 2026
Merged

refactor: use batching for SHACL/Flow link operations#685
lucksus merged 1 commit intofeat/shacl-sdna-migrationfrom
fix/shacl-batching-and-imports

Conversation

@HexaField
Copy link
Contributor

Addresses review feedback from @lucksus on #654:

Changes:

  1. Top-level imports — Moved SHACLShape and SHACLFlow imports from inline import() to top-level static imports
  2. Batch link writesaddShacl() and addFlow() now use addLinks() to batch all links in a single call instead of individual add() calls
  3. Single surreal query for readsgetShacl() and getFlow() now use a single querySurrealDB() call instead of many individual get() calls

Net result: ~74 lines added, ~146 removed. Much fewer round-trips to the executor.

…ry for reads

Addresses review feedback from @lucksus on PR #654:
- Move SHACLShape and SHACLFlow imports to top-level instead of inline dynamic imports
- Use addLinks() batch API instead of individual add() calls in addShacl() and addFlow()
- Use single querySurrealDB() call instead of many get() calls in getShacl() and getFlow()
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/shacl-batching-and-imports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@lucksus lucksus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks Hex :)

predicate: "ad4m://destructor"
}));
shapeLinks.push(...destructorLinks.map(l => l.data));
const query = `SELECT in.uri AS source, predicate, out.uri AS target FROM link WHERE in.uri IN [${escapedSources}]`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soo much cleaner!

@lucksus lucksus merged commit 844d08b into feat/shacl-sdna-migration Feb 19, 2026
5 checks passed
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