lapis
lapis copied to clipboard
Model\create! crashes
When you attempt to call create without arguments it crashes with the error [...]model.lua:169: bad argument #1 to 'pairs' (table expected, got nil)
I'm not sure if there's any use-cases for this, and I only found it myself because I was playing around with it, so maybe it's not worth fixing. Either way, it can be fixed with just adding a default parameter {} to the function.
Okay, I take back the part about it being easy to solve. As it turns out, lapis doesn't handle empty value sets well and just creates a query like INSERT INTO "table" () VALUES () ... instead of INSERT INTO "table" DEFAULT VALUES ... as it should be.
I think we should throw a more descriptive error when calling without {}
It actually fails when calling with an empty table {} as well, so there isn't really a way to create a DEFAULT VALUES query :|