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

Doc comments are not generated when selecting a single column #4104

Closed
silverhammermba opened this issue Apr 25, 2023 · 1 comment
Closed
Labels
Milestone

Comments

@silverhammermba
Copy link

silverhammermba commented Apr 25, 2023

SQLDelight Version

1.5.5

Operating System

Multiplatform

Gradle Version

7.4.2

Kotlin Version

1.7.20

Dialect

3.24

AGP Version

N/A

Describe the Bug

In this .sq file, the second comment does not result in the generated method having a doc comment:

CREATE TABLE iconPreference (
  href TEXT PRIMARY KEY NOT NULL,
  icon TEXT NOT NULL
);

/**
 * this shows up as a doc comment
 */
selectAll:
SELECT * FROM iconPreference;

/**
 * this does not
 */
getIcon:
SELECT icon FROM iconPreference WHERE href = ?;

The generated interface looks like this

public interface IconPreferenceQueries : Transacter {
  public fun <T : Any> selectAll(mapper: (href: String, icon: String) -> T): Query<T>

  /**
   * this shows up as a doc comment
   */
  public fun selectAll(): Query<IconPreference>

  public fun getIcon(href: String): Query<String>
}

I have not observed this with any other kind of query (insert, update, delete, select *, or select with two or more explicit columns).

It would also be nice if the doc comment for selectAll showed up for both methods which are generated for it, but I care more about the other comment being dropped completely.

Stacktrace

No response

Gradle Build Script

No response

@AlecKazakova AlecKazakova added this to the 2.0 milestone Apr 25, 2023
@dellisd
Copy link
Collaborator

dellisd commented Apr 28, 2023

This was fixed in #3554 which is available in the latest 2.0 alpha.

@dellisd dellisd closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants