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

Use $limitnum argument of get_records_sql to fix the MSSQL syntax issue #205

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

dlmsr
Copy link
Contributor

@dlmsr dlmsr commented Mar 7, 2025

#101 proposed a fix for a SQL query that used syntax not known to MSSQL. This fix is not database-agnostic. The present PR provides a database-agnostic solution to the problem.

dlmsr added 2 commits March 7, 2025 13:31
…soft SQL Server (#101)"

This reverts commit 2fa7dc6.

The solution to the SQL dialect issue is suboptimal. Moodle’s datalib
provides the right means of abstraction to formulate our query without
database-specific code. We can use the parameter $limitnum from the
method get_records_sql of the class moodle_database.
Use the parameter $limitnum of the get_records_sql method. This
provides the means to limit the records to only the first one and is
database-agnostic.
@dlmsr dlmsr requested a review from bluetom March 7, 2025 12:34
@dlmsr dlmsr merged commit 55a094c into master Mar 7, 2025
50 checks passed
@dlmsr dlmsr deleted the mssql-fix branch March 7, 2025 12:46
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