Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSQLite: `NOT NULL` not checked at incremental builds #870
Comments
This comment has been minimized.
|
I'm surprised that this causes issues with incremental compilation specifically. One unfortunate property of Can you provide a full set of steps that I can follow to reproduce this issue, where following those steps with incremental compilation turned on causes things to incorrectly compile, but following them with incremental compilation disabled does not? There's not enough information to reproduce/identify the issue here. |
This comment has been minimized.
fbruetting
commented
Apr 30, 2017
•
|
Diesel.zip
There should be a better error message, if there's an error in the up.sql. Assuming something that should be, is always a source of problems – please handle this more strictly! Other question: Why doesn't Diesel work without these NOT NULL statements? // PS 1: Why is a completely empty database file created at compilation, if I don't create it by running the diesel command? |
This comment has been minimized.
|
Modifying a migration does not change your database. It is expected that you always create a new migration or roll back the migration before modifying it. Everything else you've mentioned falls into what I mentioned above. Cargo doesn't know that your database changed if you had no code changes. It has nothing to do with incremental compilation.
Are you trying to load data into a field that isn't an
SQLite creates the database file if it doesn't exist when you establish a connection. This is regardless of Diesel.
Run I'm going to close this as I don't see any actionable issue here |
fbruetting commentedApr 24, 2017
•
edited
If I put
NOT NULLin every entry of my SQLite up.sql, compilation works fine.After the first compilation, I can leave
NOT NULLout and it still compiles fine, but as soon as cargo has to do a full compilation (I deleted the target folder and the database), I get strange error messages like shown below. So ifNOT NULLis necessary, it needs to be checked in incremental compilation, too. Or should Diesel work in conjunction with SQLite without the need for specifyingNOT NULLon every attribute?And this has something to to with both the binarys and the database file, since I always have to delete the database and the target folder before full compilation, for the bug to appear. However, if I correct the up.sql, I just have to delete the database, and incremental compilation then works.
Tested with 0.11 and 0.12 on Rust stable.