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

We generate a poor error message when `infer_schema!` is used on an empty database #1393

Closed
sgrif opened this Issue Dec 14, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@sgrif
Member

sgrif commented Dec 14, 2017

Steps to reproduce:

Use infer_schema!("empty_database_file.sqlite3");

This should generate no code, but instead it errors out with "unexpected end of macro invocation".

@sgrif

This comment has been minimized.

Member

sgrif commented Dec 14, 2017

It looks like infer_schema! actually finishes fine, but the code it generates is allow_tables_to_appear_in_same_query!() which doesn't have a matcher for zero tokens

@bitemyapp

This comment has been minimized.

bitemyapp commented Dec 14, 2017

Is "empty database" inclusive of "wrong filepath?" That was what happened in my case.

@sgrif

This comment has been minimized.

Member

sgrif commented Dec 14, 2017

Yes, pointing to a file which doesn't exist would cause SQLite to create a new database at that location, which would be empty.

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 15, 2018

This was resolved.

@sgrif sgrif closed this Jan 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment