Skip to content

feat: add query execution for mode discovery - #499

Open
aaqilniz wants to merge 1 commit into
loopbackio:masterfrom
aaqilniz:feat/strict-mode
Open

aaqilniz wants to merge 1 commit into
loopbackio:masterfrom
aaqilniz:feat/strict-mode

Conversation

@aaqilniz

@aaqilniz aaqilniz commented Mar 3, 2024 •

Copy link
Copy Markdown
Contributor

This PR adds the base discoverIsStrict interface and abstract buildQueryIsStrict method to SQLConnector in loopback-connector, enabling SQL connectors to expose database strict-mode detection up to loopback-datasource-juggler.

Purpose and Context

This is part of the cross-package effort to ensure that when a database (like MySQL) runs in strict mode, model discovery populates jsonSchema.maxLength alongside the top-level length property to trigger application-level validation.

Key Changes

  • Added SQLConnector.prototype.discoverIsStrict() to execute strict-mode queries.
  • Added abstract SQLConnector.prototype.buildQueryIsStrict() requiring implementation by child connectors.
  • Updated mock test connector and added unit test coverage.

Related Issue:

Related PRs:

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@coveralls

coveralls commented Mar 3, 2024 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 8131673125

Details

  • 1 of 8 (12.5%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 59.222%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/sql.js 1 8 12.5%
Files with Coverage Reduction New Missed Lines %
lib/sql.js 5 50.77%
Totals Coverage Status
Change from base Build 8101065918: -0.09%
Covered Lines: 715
Relevant Lines: 1139

💛 - Coveralls

@aaqilniz
aaqilniz marked this pull request as ready for review April 13, 2024 17:03
@aaqilniz
aaqilniz requested a review from dhmlau as a code owner April 13, 2024 17:03
@aaqilniz
aaqilniz marked this pull request as draft October 25, 2026 10:19
@aaqilniz
aaqilniz force-pushed the feat/strict-mode branch 2 times, most recently from 7afda97 to a9d261b Compare October 25, 2026 15:52
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
@aaqilniz
aaqilniz marked this pull request as ready for review October 25, 2026 15:59
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