1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

Fabrik table name in Joomla db

Discussion in 'Community' started by lvth, Nov 28, 2021.

  1. lvth

    lvth New Member

    Level: Community
    I did a search without success... how can I create the table for a specific form using standard Joomla notation, i.e. starting with an # to make it independent form specific db instance?
    Or is Fabrik unable to use this Joomla feature?
    If I export my db to transfer the site to a different server Joomla makes it easy to chenge table prefix, because of the # usage.
  2. lousyfool

    lousyfool Well-Known Member

    Level: Community
    When creating new tables, simply include your DB prefix in their name.
    E.g., if your DB prefix is "jos_", then name your new table "jos_my_new_table".
    "#__" will work fine in other extensions or your own code.
  3. lvth

    lvth New Member

    Level: Community
    Ok, that's easy, but I loose the capability of changing prefix when exporting db to different environment...
    Thanks anyway for your suggestion...
  4. lousyfool

    lousyfool Well-Known Member

    Level: Community
    No, why?
    Not sure why you feel the need to change the prefix. But anyway, if you're not familiar with it already, consider using Akeeba Backup and Akeeba Kickstart to migrate your site. It's "the gold standard" and offers you the option to change the DB table prefix, too, if you insist.
  5. lvth

    lvth New Member

    Level: Community
    Exact, as you say it's "the gold standard", so EVERY part of Joomla (core or extension) should use the prefix mechanism in the form of "#_tablename", thus allowing Akeeba (e.g.) to change prefix if for any reason you need it, but Fabrik seems not to use this method, or at least so is what I understand. Maybe I'm a newbie (for sure) with Fabrik, maybe somewhere you can specifiy this, but I did'nt find it.
    If I name my table in Fabrik as "gigi_tablename" I'm almost sure Akeeba can change it, but what will Fabrik do after that? Where is Fabrik keeping the name of the table INSIDE some configuration field? Will Akeeba change also this? I'm almost sure NOT.
    Anyway, thanks for you help.
  6. lousyfool

    lousyfool Well-Known Member

    Level: Community
    When creating a new list in Fabrik, you enter the DB table name yourself, so it's up to you to include the table prefix or not***.

    I am always including the prefix in my Fabrik table names, but there are plenty of other users here who don't. However, I've never read here of anyone having trouble with Akeeba Backup due to this, so I can only guess Akeeba does it right and doesn't add a prefix to non-prefixed tables.

    Again, there should be nothing for you to worry about.

    *** = Unless you want to change prefixes later for some reason -- see @troester's post here below!
    Last edited: Nov 30, 2021
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    Fabrik uses the #_ standard for it's own metadata tables and for e.g. the user element or juser plugin which are linking to Joomla's core tables.

    Fabrik lists are data tables, independent from Joomla or Fabrik core metadata tables which also may be coming from or used by totally different software or even be on different databases or servers.
    So no, for its data table names Fabrik does't support the #_ notation.

    If you want to change your Joomla prefix on site copies you should NOT use the Joomla prefix for your data tables.
    lousyfool likes this.
  8. lousyfool

    lousyfool Well-Known Member

    Level: Community
    Well well... thanks @troester... you're just reminding me that (at least) placeholders would all go to hell once the prefix changed. So, yes, you're right and I was wrong, kinda... but then, while I'm using prefixes with Fabrik tables, I never change prefixes when migrating sites...
  9. lvth

    lvth New Member

    Level: Community
    Ok, I understand that Fabrik tables could (conditionally ...) be extraneous to the Joomla db, but then you should add an option that distinguishes if the table is internal to Joomla or not. In the first case Fabrik should manage the # like all the other Joomla components.
    An example of why I would like to change the prefix is to be able to have TWO versions of the site hosted in a single database due to the rules of the provider I use (maybe it's a poor provider, but you never know).
    But in my not too short experience of using Joomla (and other CMS) this case can occur.
    In case I need to duplicate the tables to have two versions of the site on a single db I would have to manually correct the table name, both in the db (I know how to do it) and in the "form" configuration data within the Fabrik configuration (I've searched option but I don't know how to do it except going deep in Sql, knowing how Fabrik works...).
    I have no controversial intentions, and I understand the positions of both @lousyfool and @troester, but I try to understand the limits of each tool I am using. If these limits are insurmountable, I make a reason for it, but I think it is useful to point it out.
    Thanks to @lousyfool and @troester for the clear explanations.
  10. lousyfool

    lousyfool Well-Known Member

    Level: Community
    Indeed, running a clone of a Fabrik site in the same single DB as the original site is not possible without (a) using prefixes for DB tables, and editing (b) numerous cells in Fabrik tables and (c), in your own code, all placeholders of list elements and potentially other references.
    That's a logical consequence of Fabrik's structure and features, making it relatively easy for you to work with it in other aspects.
  11. juuser

    juuser Well-Known Member

    Level: Community
    Having a need for several sites in one database is a "real corner case" nowadays. There are hosting providers that provide a plan with 10 and more databases for as low as 5 bucks per month.
    troester likes this.

Share This Page