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

Infer macros with CI #84

Closed
mcasper opened this Issue Jan 11, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@mcasper
Collaborator

mcasper commented Jan 11, 2016

What's the recommended way of dealing with the infer_* macros and CIs? Say if you have

infer_table_from_schema!(dotenv!("DATABASE_URL"), "users");

You can create the database in a before_script with Travis, but the table still won't exist at compile time. You could obviously also create the table in the before_script section, but that feels like it would get onerous as your number of tables grows.

I realize there may be no easy way of dealing with this since it is a convenience compile-time check, just wanted to see if you had a nice way.

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 11, 2016

cargo install diesel_cli && diesel migration run in before_script should make sure that they exist at compile time. You can also do diesel::migrations::run_pending_migrations from build.rs.

@mcasper

This comment has been minimized.

Collaborator

mcasper commented Jan 11, 2016

Oh right, the migrations cli is out. Wonderful! Thank you

@mcasper mcasper closed this Jan 11, 2016

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