Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for databases without parametrized queries #45

Open
aplavin opened this issue Dec 3, 2023 · 0 comments
Open

Support for databases without parametrized queries #45

aplavin opened this issue Dec 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@aplavin
Copy link
Contributor

aplavin commented Dec 3, 2023

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!

@clarkevans clarkevans added the enhancement New feature or request label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants