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

Builtin support select from sqlite_schema #1142

Closed
raidenluikang opened this issue Feb 9, 2023 · 6 comments · Fixed by #1166
Closed

Builtin support select from sqlite_schema #1142

raidenluikang opened this issue Feb 9, 2023 · 6 comments · Fixed by #1166
Labels

Comments

@raidenluikang
Copy link

I couldn't find a way how to select arbitrary columns from SQLITE builin table sqlite_schema.

Could add this feature?

reference: https://www.sqlite.org/schematab.html

@fnc12
Copy link
Owner

fnc12 commented Feb 9, 2023

what exactly do you need to query?

@fnc12 fnc12 added the question label Feb 9, 2023
@raidenluikang
Copy link
Author

raidenluikang commented Feb 10, 2023

I use following query:
select sql from sqlite_master where type = 'table' order by tbl_name asc

//NOTE: sqlite_master is alias of sqlite_schema table.

But why limit with the concrete query?

Generic case, may be useful the select any column from sqlite_schema table with any where condition with ordery by , offset limit functionality.

@fnc12 fnc12 added feature and removed question labels Feb 10, 2023
@fnc12
Copy link
Owner

fnc12 commented Feb 10, 2023

ok we can add sqlite_master as a struct in the library as we did with sqlite_orm::dbstat struct. It may allow calling raw storage.select(&sqlite_master::sql) which will return std::vector<std::string>. @raidenluikang what do you think?

@raidenluikang
Copy link
Author

raidenluikang commented Feb 10, 2023

@fnc12 I think that , it is a good idea. Only I suggest use original sqlite_schema name instead of old aliases as sqlite_master, sqlite_temp_schema, or sqlite_temp_master.

reference: https://www.sqlite.org/schematab.html

Thanks.

@trueqbit trueqbit linked a pull request Mar 25, 2023 that will close this issue
@fnc12
Copy link
Owner

fnc12 commented Oct 8, 2023

@raidenluikang @trueqbit I guess we can close this issue. @raidenluikang is everything good?

@fnc12
Copy link
Owner

fnc12 commented Oct 10, 2023

closing due to inactivity

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

Successfully merging a pull request may close this issue.

2 participants