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

Allow exluding tables from infer_schema!() macro #1115

Closed
Boscop opened this Issue Aug 17, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@Boscop

Boscop commented Aug 17, 2017

Useful for virtual FTS tables which don't have a primary key.
The only way is to manually write the schema for all other tables, which shouldn't be necessary.

Btw, excluding it in the cli doesn't work:

>diesel print-schema -b foo
thread 'main' panicked at 'Could not load table `foo`: StringError("Diesel only
supports tables with primary keys. Table foo has no primary key")', src\libcore\
result.rs:860:4

Btw, my diesel cli version is diesel 0.15.0.

@Boscop Boscop changed the title from Allow exluding tables from infer_schema to Allow exluding tables from infer_schema!() macro Aug 17, 2017

@killercup killercup added the sqlite label Aug 18, 2017

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 19, 2017

If nothing else, we should fix the behavior in diesel print-schema

@sgrif sgrif removed the sqlite label Aug 19, 2017

@Eijebong

This comment has been minimized.

Member

Eijebong commented Aug 19, 2017

I can't reproduce the print-schema bug :/

@Boscop What OS are you running ?

@Boscop

This comment has been minimized.

Boscop commented Aug 19, 2017

Win 8.1

@pocket7878

This comment has been minimized.

pocket7878 commented Dec 10, 2017

Any updates on this? Currently I'm trying to rewrite my API server from Rails to Rust.
But I can't use infer_schema! since rails using schema_migrations table to hold migration history, and it has no primary key.

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 17, 2018

I haven't been able to reproduce the issue. Since diesel print-schema is the recommended usage, which does support blacklisting, I don't think there's a major need to add it to infer_schema! which is mainly intended for use while prototyping. If someone can provide steps to reproduce a bug in the blacklisting behavior of diesel print-schema, please open a new issue with full steps to reproduce, including a migration file to set up the schema in question.

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