datalevin

Casey 2024-10-16T10:34:20.395949Z

I saw https://github.com/juji-io/datalevin/issues/126 was closed recently which implements :limit and :offset is it intentional that you cannot specify an :offset of 0 ?

Huahai 2024-10-16T16:31:04.382829Z

It was intentional, but I can be persuaded otherwise.

Huahai 2024-10-16T16:33:11.688689Z

I was thinking that if you put 0 for :offset, you might as well drop it altogether. However, now I think about it. It is more convenient to allow 0, especially if the query is generated programmatically. Sure, we will allow it in the next version.

Huahai 2024-10-16T16:36:45.826799Z

Thank you for pointing this out.

Casey 2024-10-16T17:12:54.051709Z

Yes, that was exactly how I discovered 0 was not allowed, because I was generating queries and defaulted to 0, but defaulting to nil also worked

🙏 1
2024-10-17T10:09:04.972229Z

I ran into the same issue too, programatically building queries, at first I felt it should support 0 as that’s what sql databases do too, but then I wasn’t so sure. Btw, if you’re building more complex datalog queries programatically this library is fun https://github.com/favila/qslice

👍 1
Huahai 2024-11-07T06:23:17.619079Z

resolved

🎉 1