Skip to content

Support for databases without parametrized queries #45

Open
@aplavin

Description

@aplavin

I wonder if it would be possible for FunSQL to support databases/engines that can execute SQL queries specified as regular strings, but don't have query parameter support.
A specific example that I played with and it didn't work is so-called "Virtual Observatory Table Access Protocol" (https://www.ivoa.net/documents/TAP/). There's my VirtualObservatory.jl package that implements DBInterface for such databases.

This is what I tried:

using VirtualObservatory
using FunSQL

conn = TAPService(:simbad)

# queries work same as elsewhere in dbinterface
execute(conn, "select top 10 * from basic")

# not 100% correct, just put something here for now
FunSQL.SQLDialect(::Type{TAPService}) = FunSQL.SQLDialect(:sqlite)

catalog = FunSQL.reflect(conn)

but it throws MethodError: no method matching prepare(::VirtualObservatory.TAPService, ::String). Of course, prepare could be trivially implemented as a no-op, but I see that the next line in reflect (https://github.com/MechanicalRabbit/FunSQL.jl/blob/master/src/reflect.jl#L90) executes the prepared query together with some parameter values. This part isn't natively supported by TAP.

Would be nice to be able to use FunSQL here!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions