Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Virtual tables: Generate type if returned from query #4039

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

Closed
hfhbd opened this issue Apr 5, 2023 · 8 comments · Fixed by #4427
Closed

Virtual tables: Generate type if returned from query #4039

hfhbd opened this issue Apr 5, 2023 · 8 comments · Fixed by #4427
Assignees
Milestone

Comments

@hfhbd
Copy link
Collaborator

hfhbd commented Apr 5, 2023

See #4015 (comment)

CREATE VIRTUAL TABLE myftstable2 USING fts5(something TEXT, nice TEXT);

selectFromTable2:
SELECT *
FROM myftstable2;
public fun selectFromTable2(): Query<Myftstable2> = selectFromTable2 { something, nice ->
  Myftstable2( // the table is virtual and there is no Myftstable2 data class generated
    something,
    nice
  )
}
@hfhbd
Copy link
Collaborator Author

hfhbd commented Apr 11, 2023

Added to 2.0 because this causes compiler errors.

@hfhbd hfhbd added this to the 2.0 milestone Apr 11, 2023
@hfhbd
Copy link
Collaborator Author

hfhbd commented Jul 5, 2023

We need the same/similar behavior for the system tables, when we decide to only generate them when they are actually returned.

@hfhbd
Copy link
Collaborator Author

hfhbd commented Jul 16, 2023

@AlecStrong How should it work when we create this table in module a without any queries using it but only use it in queries defined in module b with a db dependency? Currently, we don't generate types defined in dependencies tables but assume these types are available.

One option: Simple revert #4015...

@AlecKazakova
Copy link
Collaborator

It should be doing the same thing as it would for virtual/system tables in the same module where it creates a new query type

@hfhbd
Copy link
Collaborator Author

hfhbd commented Jul 17, 2023

Okay, do you want to implement it? Otherwise I will do it.

@AlecKazakova
Copy link
Collaborator

go for it

@hfhbd hfhbd self-assigned this Jul 17, 2023
@dellisd
Copy link
Collaborator

dellisd commented Jul 26, 2023

I ran into this today while trying to upgrade one of my side projects to the release candidates. Given its impact on FTS queries, I think it's a must-fix for 2.0. @AlecStrong

@hfhbd
Copy link
Collaborator Author

hfhbd commented Jul 26, 2023

Sorry, needed to prioritise work stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants