Skip to content

error using the in operator #33

@pstaabp

Description

@pstaabp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions