-
Notifications
You must be signed in to change notification settings - Fork 128
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
Documentation - How should database table and column names be written #269
Comments
Hi, i'm just out of the production department meeting where we discussed this issue here. We acknowled the thing issue but for now there are no plans to add and implement a rule guide for extensions beyond that what we already have and can be found in the docs wiki for example: https://docs.joomla.org/Category:Beginner_Development As Joomla 4 gets closer to a realease that docs get updated to the Joomla 4 style to build components. A general recomendation for any new person would be to check the extensions supplied by the core, but i clearly want to mention here that what we do there is a example and no official rule or such kind of things and we also know that the core extensions are not perfect nor always consistend. I hope that helps you, i know thats not the answear you wanted to hear but right now our main focus is to get Joomla 4 out and we only have limited resources. :) |
@zero-24 Thanks for mentioning this. I also 100% appreciate that Joomla 4 is a priority The guides have no information in this, hence my boggle. Maybe a note about this issue on the relevant page saying that the joomla core team is aware of this and that currently there is no right answer at the moment I could also write a real world example A and B (snake_case and dromedaCase) going down from the database column all the way to using it in a template and a quick note saying that this will not violate current code syntax rules as currently both methods are excepted. I will do some examples and post them here Either or both of these will stop people hunting for an answer and the Joomla team can point people to the relevant paragraph (or here). |
That would be great. The wiki is a media wiki so you can create a account and add some good examples with recomendations would be very great. I'm happy to help with the setup where needed just contact me. That should work as a starting point When done please send me your username so I can ask you to be promoted so you can bypass the spam restrictions. ;) |
Table names
In the Joomla database all the table names are in
snake_case
and by the looks of this is how it will always be, However this is not in the Joomla Documentation anywhere, at least not that I have found and I think it should be added for clarity.Column Names
Most column names in joomla and 3rd party extension are
snake_case
but some arecamelCase/dromedaryCase
.There is no official documentation on how one should name a column including how and when column comments should be added. This should be added to the documentation so I know which style to use for my database.
This is exactly the why I need clarity for the table names.
On the first post under the 4. Parameter Variable name I have written a small worked example of this:
Params
On a related issue, how would this change the names/keys of variables in $params, should they follow the same syntax as the table names for consistency? this needs to be addressed at the same time. And why this matters is you tend to define all of these parameters in your extensions XML files and you might have direct table names and values from parameters being looked up.
I can expand on this if anyone wants any further info from me.
This issue came about when I was making my reference extensions and found these standards missing.
thanks
Other Database related info for the database documentation
Null
value rather than000:00:00 00:00
see hereThe text was updated successfully, but these errors were encountered: