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

Preserve multi-line comment order #3412

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

notstfn
Copy link
Contributor

@notstfn notstfn commented Jan 16, 2025

Description

This PR fixes an issue where multi-line comments in SQL were reversed in the generated Dart models. For example:

-- First comment.
-- Second comment.
title TEXT NOT NULL

Previously generated:

/// Second comment.
/// First comment.
final String title;

Now generates:

/// First comment.
/// Second comment.
final String title;

The fix updates the comment collection logic to preserve the correct order. A test case has been added to verify this behavior.

While this change addresses the issue for column comments, I’m not entirely sure if it might affect other parts of the system. Feedback or additional testing suggestions would be appreciated!

Copy link
Owner

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

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

Ouch. Good catch, thank you for the contribution!

@simolus3 simolus3 merged commit 2f3351d into simolus3:develop Jan 16, 2025
16 checks passed
@notstfn notstfn deleted the sql-multiline-comments branch January 17, 2025 01:12
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