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

Sort Changes by the specified field other than the primary key #259

Open
Sergey-citc opened this issue Nov 14, 2022 · 1 comment
Open

Sort Changes by the specified field other than the primary key #259

Sergey-citc opened this issue Nov 14, 2022 · 1 comment

Comments

@Sergey-citc
Copy link

According to documentation, changes sorted by primary key and if there are no primary key by the values of the row (for a modification).
My table has a primary key, but it doesn't fit because it has a type UUID. So the changes is sorted randomly.

Is there any function to set sorting on any other field? If not, can you add?

I tried like below code, it doesn't work:

Table(dataSource, "table_name", arrayOf(Order.asc("created")))...

@clemstoquart
Copy link

Hello,

You can do something like that:

// Get the data from "members" table and order on "name" column in ascending order
Table table = new Table(source, "members", new Order[] { Order.asc("name") });

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

No branches or pull requests

2 participants