Support for tables up to 256 columns #4517
Replies: 1 comment 5 replies
-
This topic comes up from time to time. The main reasons why we haven't done this yet is that we expect that compile times are really bad for such a configuration. As you already opened #4518 you could maybe comment on what compile times you observe with the 128-column-tables feature and the new 256-column-tables feature. That could help us to make a better decision there. The other thing that makes seems not to be great for me is that this introduces another feature flag that needs to be tested and ultimately there is still a limit there. That made me wonder if there would be a better solution to the underlying problem of configuring a maximal column number for diesel. Given that the code is now generated by a proc-macro we could read that value from the environment somehow and adjust the limit based on that value. Implementing that would require:
This approach has the obvious advantage that you can increase the limit only as much as needed instead of going to some fixed limit that is too large. The slight disadvantage is that it is a bit harder to configure that just enabling a feature flag. Given that we want to discourage using too large numbers there for compile time reasons and also as it is just a not great database design that seems to be a reasonable trade off for me. I'm happy to accept a PR for that. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am dealing with some legacy databases which contain extremely large tables.
While I am perfectly in agreement that it is a very poor life choice to make such large tables in the first place, I am in the unenviable position to have to design the migration of data from the legacy database into the new one.
I would like to use diesel to define the migration, and therefore I would like to introduce support for tables up to 256 columns. I took a glance at the points where the
128-column-tables
feature is mentioned, and I don't seem to identify any hard limit to the number of columns, at least, not on the diesel side of things, except for perhaps longer compile time requirements.If there are no particular reason for not having a
256-column-tables
optional feature, except for "people should know better than do such large tables", I would proceed to write the pull request to add support for the feature.Thank you for your time and have a great day,
Luca
Beta Was this translation helpful? Give feedback.
All reactions