Skip to content

500 from missing table name #184

@earthboundkid

Description

@earthboundkid

datasette/datasette/app.py

Lines 517 to 519 in 56623e4

table_definition = list(await self.execute(name, 'select sql from sqlite_master where name = :n and type="table"', {
'n': table,
}))[0][0]
throws an error if it gets an empty list back. Simplest solution is to write a helper func that just says

result = list(await self.execute(name, sql, params)
if result:
    return result[0][0]

and use it anywhere [0][0] is now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions