queryverse / queryverse/QuerySQLite.jl
error using the in operator
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 4
- Forks
- 2
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 1
Description
I was trying to do a filter for a value in an array. Here's an example using the Chinook db:
using Query, QuerySQLite
database = Database(joinpath(pathof(QuerySQLite) |> dirname |> dirname, "test", "Chinook_Sqlite.sqlite"))
database.Track |> @filter(_.AlbumId in [1,5,9])
which returns the error:
SQLite.SQLiteException("no such table: 1, 5, 9")
and piping to get_sql has [ ] around the array, where SQL needs parens ( ).
If we run:
using SQLite, DataFrames
result = DBInterface.execute(db,"SELECT * FROM (Track) WHERE AlbumId IN (1, 5, 9)") |> DataFrame
we get the expected results.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Chinook example from the issue and inspect the SQL produced by get_sql for the array used with the in operator. Compare it with the working DBInterface query; done means the filter emits valid SQLite IN syntax with parentheses and returns the expected rows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia, sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100