sqlboiler
sqlboiler copied to clipboard
Feature: Define relationships in config
This is probably a non-starter, but it would be great (albeit probably error-prone), to be able to specify relationships in config rather than relying on foreign keys. This would allow you to use sqlboiler with platform like PlanetScale that does not support foreign keys.
This sounds interesting. If you can create a PR for this feature, I'll be happy to review it.
I was just about to use SQLBoiler with PlanetScale! I had no choice but to try to use it without foreign key constraints (no relations). This is a long awaited feature!
imo this would be a nice feature in dbs with foreign keys as well, as afaict the reverse relationship is auto-derived, and cannot be renamed through a toml config, because the foreign key only exists on one of the tables
@Rosswell I believe it is possible to alias the reverse relationship using the foreign
property.
Regardless, I agree that the ability to manually define relationships would be quite useful. If only to create some "convenient" relationships that you don't necessarily need to be enforced by the DB.
@stephenafamo Could you review this PR above?
Would love to see this as well. Not being able to add non-FK columns to a join table is another limitation this would help to remove.
Implemented in #1282