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

Creation of indexes not including order or collation #784

Closed
freakstatic opened this issue Sep 6, 2021 · 12 comments
Closed

Creation of indexes not including order or collation #784

freakstatic opened this issue Sep 6, 2021 · 12 comments
Labels

Comments

@freakstatic
Copy link

freakstatic commented Sep 6, 2021

For example:

    auto storage = make_storage("db.sqlite",
                                make_index("idx_users_first_name", indexed_column(&User::first_name).desc()),
                                make_index("idx_users_first_name_2", indexed_column(&User::first_name).collate("BINARY").desc()),
                                make_index("idx_users_nr", indexed_column(&User::nr).desc()),
                            make_table("users",
                                       make_column("id", &User::id, autoincrement(), primary_key()),
                                       make_column("first_name", &User::first_name),
                                       make_column("nr", &User::nr)
                                           ));

I'm getting:

CREATE INDEX IF NOT EXISTS 'idx_users_nr' ON 'users' ('nr')
CREATE INDEX IF NOT EXISTS 'idx_users_first_name_2' ON 'users' ('first_name')
CREATE INDEX IF NOT EXISTS 'idx_users_first_name' ON 'users' ('first_name')

The "descending order" and the "collate" aren't being included in the query.
I'm missing something?
I'm using v1.6 and compiling with Apple clang version 12.0.5

@fnc12
Copy link
Owner

fnc12 commented Sep 8, 2021

Hi. Let me check it. I'll write you back

@fnc12 fnc12 added the bug label Sep 9, 2021
@fnc12
Copy link
Owner

fnc12 commented Sep 9, 2021

@freakstatic it is a bug. I am fixing it right now

@fnc12
Copy link
Owner

fnc12 commented Sep 9, 2021

the fix is here #789

@freakstatic
Copy link
Author

Hi @fnc12!
I can confirm that #789 fixes it
Thank you very much, keep your great work!

@fnc12
Copy link
Owner

fnc12 commented Sep 9, 2021

@freakstatic can you tell me please in what project you use sqlite_orm?

@freakstatic
Copy link
Author

since it hasn't been released yet I can't discuss much about it but I can say that it's an application to manage audio files. It uses a SQLite database for that, so sqlite_orm fits really great for CRUD operations! :)

@fnc12
Copy link
Owner

fnc12 commented Sep 9, 2021

wow sounds nice. I'd like to make a list of projects that use sqlite_orm here in this repo. Can you send me a link to your app once it is released please?

@freakstatic
Copy link
Author

Should I post on #783?

@fnc12
Copy link
Owner

fnc12 commented Sep 9, 2021

yeah. Thanks

@freakstatic
Copy link
Author

freakstatic commented Sep 9, 2021

Btw are you thinking of creating a hotfix for v1.6 with this fix or are you planning to wait for the new version?

@fnc12
Copy link
Owner

fnc12 commented Sep 9, 2021

I am planning to wait for a new version

@freakstatic
Copy link
Author

Ok, thanks for letting me know

@fnc12 fnc12 removed the in progress label Sep 10, 2021
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

2 participants