Skip to content

SqlBackend doesn't support querying without indexes, but it also can't create indexes #78

@somelinguist

Description

@somelinguist

I'm using the SqlBackend with sqlite. I was able to populate the database, but when I tried to run a query, I got the following error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "...\lib\site-packages\blitzdb\backends\sql\backend.py", line 1408, in filter
    compiled_query = compile_query(collection,query)
  File "...\lib\site-packages\blitzdb\backends\sql\backend.py", line 1405, in compile_query
    raise AttributeError("Query over non-indexed field %s in collection %s!" % (key,collection))
AttributeError: Query over non-indexed field analyses in collection word!

I then tried to create an index but go the following error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "...\lib\site-packages\blitzdb\backends\sql\backend.py", line 1071, in create_index
    self.db[collection].ensure_index(*args, **kwargs)
AttributeError: 'Backend' object has no attribute 'db'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions