queryverse / QuerySQLite.jl

SQLite backend for Query.jl
Other
4 stars 2 forks source link

Update to SQLite 1.0 #20

Closed davidanthoff closed 4 years ago

davidanthoff commented 4 years ago

I also handled the db that is modified a little different so it doesn't show up as dirty in git anymore.

bramtayl commented 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.

davidanthoff commented 4 years ago

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?

bramtayl commented 4 years ago

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 Ints?

davidanthoff commented 4 years ago

@quinnj, do you think this might be a problem in SQLite.jl?

quinnj commented 4 years ago

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.

bramtayl commented 4 years ago

Ref https://github.com/JuliaDatabases/SQLite.jl/issues/207

bramtayl commented 4 years ago

Thanks!