Closed leonlaser closed 9 months ago
I just read about the alternate syntax in the docs and using name
to overcome this problem, but maybe it would still be nice to align the case of the foreign key prefix to vipers current behavior?
Sorry about this, I have also been bitten by Viper's lack of case sensitivity.
but maybe it would still be nice to align the case of the foreign key prefix to vipers current behavior
I don't understand exactly what you mean.
As far as I know there is no way to change viper's behaviour, the user can either use the alternative syntax, or we have to entirely replace Viper is SQLBoiler.
@stephenafamo I mean changing the generated names of foreign keys to lowercase in this line: https://github.com/volatiletech/sqlboiler/blob/71f11953fe83273d17a7ff0436e79b1341f0286d/drivers/sqlboiler-sqlite3/driver/sqlite3.go#L486
Okay, that makes sense. Kindly send in a PR and I'll be happy to merge
Although.... I'm not sure if this should be considered a breaking change since it may break existing configuration.
Yes, I agree. Viper has an open PR to enable case sensitivity by configuration. It might be better to wait for viper to offer a solution.
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (
sqlboiler --version
)?SQLBoiler v4.15.0
What is your database and version (eg. Postgresql 10)
sqlite3
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
sqlboiler sqlite3
If this happened at runtime what code produced the issue? (if not applicable leave blank)
What is the output of the command above with the
-d
flag added to it?I included only the relevant part for the aliases, but I can also post the whole thing, if necessary.
Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Further information. What did you do, what did you expect?
I am configuring aliases for a relationship:
I expected my configuration to work, but neither
local
norforeign
are changed in the generated sources.The sqlite3 driver is creating names for each foreign key with an uppercase prefix
FK_
, but viper has no support for case sensitive keys, therefore my aliases are is not applied.