Closed davidanthoff closed 4 years ago
This looks good. Do you know why SQLite got rid of generate_namedtuple
? If you'd like to avoid generated functions (in exchange for a @pure
function), I have a function in LightQuery like this:
@pure function val_fieldtypes(a_type::DataType)
if a_type.abstract || (a_type.name == Tuple.name && Base.isvatuple(a_type))
() # for our purposes, we might want to error here
else
map(Val, (a_type.types...,))
end
end
Once you've got the field types wrapped in Val
, @inline
can take care of the rest.
Do you know why SQLite got rid of generate_namedtuple?
No idea :)
If you'd like to avoid generated functions
I think I'm indifferent. If you think that would be better, please open a PR!
Tests fail, but tests also seem to fail on master
, so maybe I'll merge and then we can figure out what is wrong there?
I'm not used to reading the CI results from GitHub actions, but the error I'm seeing is on 32 bit Linux:
│ collect(result)[1].a isa DataValue{Int}
│
│ Evaluated output:
│
│ ERROR: InexactError: trunc(Int32, -342205098811609859)
With a stacktrace leading back to this line in SQLite. Which suggests to me this might be an SQlite.jl bug related to 32 bit Int
s?
@quinnj, do you think this might be a problem in SQLite.jl?
Sorry, I think I'm missing some context here; I'm not sure what I can do to help. Is there a simple reproduction of a bug in SQLite.jl? If so, or some outline of the problem, I'm happy to take a look; even better, open an issue w/ SQLite.jl w/ the details.
Thanks!
I also handled the db that is modified a little different so it doesn't show up as dirty in git anymore.