Sql triggers executing SQL, Javascript and Java code#3222
Conversation
Summary of ChangesHello @lvca, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers a powerful new capability to ArcadeDB: database triggers. This feature enables developers to embed business logic, enforce data integrity, manage audit trails, and automate workflows directly within the database schema. By supporting SQL, JavaScript, and Java, it offers flexibility to choose the right tool for the job, from simple data manipulations to complex, high-performance operations, ensuring data consistency and reactivity at the database level. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🧪 CI InsightsHere's what we observed from your CI run for c34c62f. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
Code Review
This pull request introduces a powerful and well-designed trigger mechanism supporting SQL, JavaScript, and Java. The implementation is comprehensive, covering grammar changes, schema management, execution logic, and extensive testing, including benchmarks. The documentation is also very detailed. I've identified a significant performance improvement opportunity for JavaScript triggers and a few areas in the documentation that could be improved for clarity and to promote best practices, particularly around preventing SQL injection in examples.
engine/src/main/java/com/arcadedb/schema/trigger/ScriptTriggerExecutor.java
Outdated
Show resolved
Hide resolved
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* feat: added triggers via SQL executing SQL, JS and Java code Fixed issue #1395 * feat: added trigger benchmark * Update docs/SQL-Triggers.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update docs/SQL-Triggers.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * perf: using shared polyglot engine in triggers * Update docs/SQL-Triggers.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update docs/SQL-Triggers.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> (cherry picked from commit bc6cc4e)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.5 to 4.31.7. Release notes *Sourced from [github/codeql-action's releases](https://github.com/github/codeql-action/releases).* > v4.31.7 > ------- > > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > 4.31.7 - 05 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.7. [ArcadeData#3343](https://redirect.github.com/github/codeql-action/pull/3343) > > See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/v4.31.7/CHANGELOG.md) for more information. > > v4.31.6 > ------- > > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > 4.31.6 - 01 Dec 2025 > -------------------- > > No user facing changes. > > See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/v4.31.6/CHANGELOG.md) for more information. Changelog *Sourced from [github/codeql-action's changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md).* > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > [UNRELEASED] > ------------ > > No user facing changes. > > 4.31.7 - 05 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.7. [ArcadeData#3343](https://redirect.github.com/github/codeql-action/pull/3343) > > 4.31.6 - 01 Dec 2025 > -------------------- > > No user facing changes. > > 4.31.5 - 24 Nov 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.6. [ArcadeData#3321](https://redirect.github.com/github/codeql-action/pull/3321) > > 4.31.4 - 18 Nov 2025 > -------------------- > > No user facing changes. > > 4.31.3 - 13 Nov 2025 > -------------------- > > * CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/). > * Update default CodeQL bundle version to 2.23.5. [ArcadeData#3288](https://redirect.github.com/github/codeql-action/pull/3288) > > 4.31.2 - 30 Oct 2025 > -------------------- > > No user facing changes. > > 4.31.1 - 30 Oct 2025 > -------------------- > > * The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced. > > 4.31.0 - 24 Oct 2025 > -------------------- > > * Bump minimum CodeQL bundle version to 2.17.6. [ArcadeData#3223](https://redirect.github.com/github/codeql-action/pull/3223) > * When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [ArcadeData#3222](https://redirect.github.com/github/codeql-action/pull/3222) > > 4.30.9 - 17 Oct 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.3. [ArcadeData#3205](https://redirect.github.com/github/codeql-action/pull/3205) > * Experimental: A new `setup-codeql` action has been added which is similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. Do not use this in production as it is part of an internal experiment and subject to change at any time. [ArcadeData#3204](https://redirect.github.com/github/codeql-action/pull/3204) > > 4.30.8 - 10 Oct 2025 > -------------------- > > No user facing changes. ... (truncated) Commits * [`cf1bb45`](github/codeql-action@cf1bb45) Merge pull request [ArcadeData#3344](https://redirect.github.com/github/codeql-action/issues/3344) from github/update-v4.31.7-f5c63fadd * [`f4ebe95`](github/codeql-action@f4ebe95) Update changelog for v4.31.7 * [`f5c63fa`](github/codeql-action@f5c63fa) Merge pull request [ArcadeData#3343](https://redirect.github.com/github/codeql-action/issues/3343) from github/update-bundle/codeql-bundle-v2.23.7 * [`a2c01e7`](github/codeql-action@a2c01e7) Add changelog note * [`ac34c13`](github/codeql-action@ac34c13) Update default bundle to codeql-bundle-v2.23.7 * [`267c467`](github/codeql-action@267c467) Merge pull request [ArcadeData#3339](https://redirect.github.com/github/codeql-action/issues/3339) from github/dependabot/npm\_and\_yarn/npm-minor-77d264... * [`aeabef7`](github/codeql-action@aeabef7) Merge branch 'main' into dependabot/npm\_and\_yarn/npm-minor-77d26487b0 * [`78357d3`](github/codeql-action@78357d3) Merge pull request [ArcadeData#3341](https://redirect.github.com/github/codeql-action/issues/3341) from github/mbg/ci/update-cs-config-cli-tests * [`d61a6fa`](github/codeql-action@d61a6fa) Update CLI config test to account for overlay db changes on PRs * [`ce27e95`](github/codeql-action@ce27e95) Rebuild * Additional commits viewable in [compare view](github/codeql-action@fdbfb4d...cf1bb45) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.7 to 4.31.8. Release notes *Sourced from [github/codeql-action's releases](https://github.com/github/codeql-action/releases).* > v4.31.8 > ------- > > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > 4.31.8 - 11 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.8. [ArcadeData#3354](https://redirect.github.com/github/codeql-action/pull/3354) > > See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/v4.31.8/CHANGELOG.md) for more information. Changelog *Sourced from [github/codeql-action's changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md).* > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > [UNRELEASED] > ------------ > > No user facing changes. > > 4.31.8 - 11 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.8. [ArcadeData#3354](https://redirect.github.com/github/codeql-action/pull/3354) > > 4.31.7 - 05 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.7. [ArcadeData#3343](https://redirect.github.com/github/codeql-action/pull/3343) > > 4.31.6 - 01 Dec 2025 > -------------------- > > No user facing changes. > > 4.31.5 - 24 Nov 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.6. [ArcadeData#3321](https://redirect.github.com/github/codeql-action/pull/3321) > > 4.31.4 - 18 Nov 2025 > -------------------- > > No user facing changes. > > 4.31.3 - 13 Nov 2025 > -------------------- > > * CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/). > * Update default CodeQL bundle version to 2.23.5. [ArcadeData#3288](https://redirect.github.com/github/codeql-action/pull/3288) > > 4.31.2 - 30 Oct 2025 > -------------------- > > No user facing changes. > > 4.31.1 - 30 Oct 2025 > -------------------- > > * The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced. > > 4.31.0 - 24 Oct 2025 > -------------------- > > * Bump minimum CodeQL bundle version to 2.17.6. [ArcadeData#3223](https://redirect.github.com/github/codeql-action/pull/3223) > * When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [ArcadeData#3222](https://redirect.github.com/github/codeql-action/pull/3222) > > 4.30.9 - 17 Oct 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.3. [ArcadeData#3205](https://redirect.github.com/github/codeql-action/pull/3205) > * Experimental: A new `setup-codeql` action has been added which is similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. Do not use this in production as it is part of an internal experiment and subject to change at any time. [ArcadeData#3204](https://redirect.github.com/github/codeql-action/pull/3204) ... (truncated) Commits * [`1b168cd`](github/codeql-action@1b168cd) Merge pull request [ArcadeData#3355](https://redirect.github.com/github/codeql-action/issues/3355) from github/update-v4.31.8-1b0b941e1 * [`120f277`](github/codeql-action@120f277) Update changelog for v4.31.8 * [`1b0b941`](github/codeql-action@1b0b941) Merge pull request [ArcadeData#3354](https://redirect.github.com/github/codeql-action/issues/3354) from github/update-bundle/codeql-bundle-v2.23.8 * [`db812c1`](github/codeql-action@db812c1) Add changelog note * [`2930dba`](github/codeql-action@2930dba) Update default bundle to codeql-bundle-v2.23.8 * [`c43362b`](github/codeql-action@c43362b) Merge pull request [ArcadeData#3340](https://redirect.github.com/github/codeql-action/issues/3340) from github/kaspersv/check-for-overlayBaseSpecifier * [`002a7f2`](github/codeql-action@002a7f2) Overlay: log overlayBaseSpecifier at debug log-level * [`5b7e7fc`](github/codeql-action@5b7e7fc) Update src/codeql.ts * [`149d184`](github/codeql-action@149d184) Merge pull request [ArcadeData#3345](https://redirect.github.com/github/codeql-action/issues/3345) from github/mergeback/v4.31.7-to-main-cf1bb45a * [`97c2630`](github/codeql-action@97c2630) Rebuild * Additional commits viewable in [compare view](github/codeql-action@cf1bb45...1b168cd) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9. Release notes *Sourced from [github/codeql-action's releases](https://github.com/github/codeql-action/releases).* > v4.31.9 > ------- > > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > 4.31.9 - 16 Dec 2025 > -------------------- > > No user facing changes. > > See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/v4.31.9/CHANGELOG.md) for more information. Changelog *Sourced from [github/codeql-action's changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md).* > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > [UNRELEASED] > ------------ > > No user facing changes. > > 4.31.9 - 16 Dec 2025 > -------------------- > > No user facing changes. > > 4.31.8 - 11 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.8. [ArcadeData#3354](https://redirect.github.com/github/codeql-action/pull/3354) > > 4.31.7 - 05 Dec 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.7. [ArcadeData#3343](https://redirect.github.com/github/codeql-action/pull/3343) > > 4.31.6 - 01 Dec 2025 > -------------------- > > No user facing changes. > > 4.31.5 - 24 Nov 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.6. [ArcadeData#3321](https://redirect.github.com/github/codeql-action/pull/3321) > > 4.31.4 - 18 Nov 2025 > -------------------- > > No user facing changes. > > 4.31.3 - 13 Nov 2025 > -------------------- > > * CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/). > * Update default CodeQL bundle version to 2.23.5. [ArcadeData#3288](https://redirect.github.com/github/codeql-action/pull/3288) > > 4.31.2 - 30 Oct 2025 > -------------------- > > No user facing changes. > > 4.31.1 - 30 Oct 2025 > -------------------- > > * The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced. > > 4.31.0 - 24 Oct 2025 > -------------------- > > * Bump minimum CodeQL bundle version to 2.17.6. [ArcadeData#3223](https://redirect.github.com/github/codeql-action/pull/3223) > * When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [ArcadeData#3222](https://redirect.github.com/github/codeql-action/pull/3222) ... (truncated) Commits * [`5d4e8d1`](github/codeql-action@5d4e8d1) Merge pull request [ArcadeData#3371](https://redirect.github.com/github/codeql-action/issues/3371) from github/update-v4.31.9-998798e34 * [`1dc115f`](github/codeql-action@1dc115f) Update changelog for v4.31.9 * [`998798e`](github/codeql-action@998798e) Merge pull request [ArcadeData#3352](https://redirect.github.com/github/codeql-action/issues/3352) from github/nickrolfe/jar-min-ff-cleanup * [`5eb7519`](github/codeql-action@5eb7519) Merge pull request [ArcadeData#3358](https://redirect.github.com/github/codeql-action/issues/3358) from github/henrymercer/database-upload-telemetry * [`d29eddb`](github/codeql-action@d29eddb) Extract version number to constant * [`e962687`](github/codeql-action@e962687) Merge branch 'main' into henrymercer/database-upload-telemetry * [`19c7f96`](github/codeql-action@19c7f96) Rename `isOverlayBase` * [`ae5de9a`](github/codeql-action@ae5de9a) Use `getErrorMessage` in log too * [`0cb8633`](github/codeql-action@0cb8633) Prefer `performance.now()` * [`c07cc0d`](github/codeql-action@c07cc0d) Merge pull request [ArcadeData#3351](https://redirect.github.com/github/codeql-action/issues/3351) from github/henrymercer/ghec-dr-determine-tools-vers... * Additional commits viewable in [compare view](github/codeql-action@1b168cd...5d4e8d1) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
No description provided.