Extension development: too short table and columns names

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
User avatar
martti
Registered User
Posts: 45
Joined: Wed Aug 20, 2014 4:50 pm
Location: Belgium

Extension development: too short table and columns names

Post by martti »

Table and column names in the database can currently only be 30 characters long.
In order to keep things nicely separated I would always prefix tables and columns from extensions with vendor_extensionname_. But 30 characters is way too short for doing this. Is there any reason why there is a 30 character limit?

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 373
Joined: Thu Sep 16, 2004 9:02 am
Contact:

Re: Extension development: too short table and columns names

Post by Paul »

Yes, some database systems limit the length of a table name.

User avatar
martti
Registered User
Posts: 45
Joined: Wed Aug 20, 2014 4:50 pm
Location: Belgium

Re: Extension development: too short table and columns names

Post by martti »

I did a quick Google search on the databases supported by phpBB. Oracle seems to be the culprit.
  • Oracle:
    • up to version 12.1: maximum 30 bytes
    • From version 12.2 (March 2017): maximum 128 bytes
  • MySQL: 64 characters
  • MariaDB: 64 characters
  • PostGreSQL: default 63 bytes, but configurable to be larger
  • Sqlite3: no hard limit, only limited by the max length of the SQL statement (which is defaulted to 1000000 bytes, but configurable to be larger)
  • MSSQL: 128 characters
How about keeping the 30 character limit for the core, but allowing 63 bytes for the extensions?

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: Extension development: too short table and columns names

Post by david63 »

martti wrote: Mon Apr 23, 2018 9:31 am How about keeping the 30 character limit for the core, but allowing 63 bytes for the extensions?
That would imply that anyone using Oracle would not be installing extensions (may possibly be true, but cannot be guaranteed)
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
martti
Registered User
Posts: 45
Joined: Wed Aug 20, 2014 4:50 pm
Location: Belgium

Re: Extension development: too short table and columns names

Post by martti »

david63 wrote: Mon Apr 23, 2018 9:59 am
martti wrote: Mon Apr 23, 2018 9:31 am How about keeping the 30 character limit for the core, but allowing 63 bytes for the extensions?
That would imply that anyone using Oracle would not be installing extensions (may possibly be true, but cannot be guaranteed)
  • Only Oracle pre 12.2
  • Only extensions that define column or table names longer than 30 chars. It can be a requirement of the extension on the database used.

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: Extension development: too short table and columns names

Post by 3Di »

Using shorthands/acronyms is the way to go. As it is now, no need to add rules/regulations here IMHO.

mae_settings --->MyAwesomeExtension_settings

If I may say mine I'd like to see people involved in much more important things such as closing long standing tickets etc. etc.
The more the better. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Extension development: too short table and columns names

Post by DavidIQ »

It's also not just table names. There's limitations on index names as well. In any case I'm not sure that adding conditionals to the dbal for doing different things depending on dbms versions is something we'd want to do (more of). However there's been some discussions about just going with Doctrine's ORM instead of continuing with our dbal so maybe this would get addressed at that point.
Image

User avatar
martti
Registered User
Posts: 45
Joined: Wed Aug 20, 2014 4:50 pm
Location: Belgium

Re: Extension development: too short table and columns names

Post by martti »

3Di wrote: Tue Apr 24, 2018 5:20 am Using shorthands/acronyms is the way to go. As it is now, no need to add rules/regulations here IMHO.

mae_settings --->MyAwesomeExtension_settings
That's good for now, but it would be cleaner if you use the same prefix everywhere (instant recognisable) for anything related to your extension.
DavidIQ wrote: Tue Apr 24, 2018 12:15 pm It's also not just table names. There's limitations on index names as well. In any case I'm not sure that adding conditionals to the dbal for doing different things depending on dbms versions is something we'd want to do (more of). However there's been some discussions about just going with Doctrine's ORM instead of continuing with our dbal so maybe this would get addressed at that point.
Doctrine ORM trims column-names and adds a counter-number, but there is an open bug on it. And I don't know about the indexes and tables.

However, phpBB could implement its own NamingStrategy in Doctrine.

User avatar
martti
Registered User
Posts: 45
Joined: Wed Aug 20, 2014 4:50 pm
Location: Belgium

Re: Extension development: too short table and columns names

Post by martti »

DavidIQ wrote: Tue Apr 24, 2018 12:15 pm However there's been some discussions about just going with Doctrine's ORM instead of continuing with our dbal so maybe this would get addressed at that point.
Isn't it Doctrine DBAL instead of ORM? I hope it's not ORM!
https://area51.phpbb.com/phpBB/viewtopi ... rm#p255735

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Extension development: too short table and columns names

Post by DavidIQ »

Yeah that. :razz:
Image

Post Reply