Copyright 2019 - Schultz IT Solutions - swiss servicequality for austrian and international enterprises - All rights reserved.

jDBexport does not (and will not) import/update/insert/delete into database

  • Rüdiger Schultz
  • Rüdiger Schultz's Avatar Topic Author
More
04 Dec 2012 17:04 - 29 Jan 2018 08:25 #1 by Rüdiger Schultz
Dear all,

as we are repeatedly (and increasingly) asked whether jDBexport can be used to update the database (either the JOOMLA database or another one), let me clarify this issue...

jDBexport is designed as a data reporting instrument, and as such can only export data from the database(s), not import - hence the name jDBexport...

jDBexport in it's versionbranch 3.0 does not contain any libraries that can read spreadsheets.
jDBexport in it's versionbranch 3.1 (and later) relies on PHPExcel as underlying library to create spreadsheets. This library is capable of reading spreadsheets. However we decided to exclude this part of the library from jDBexport and do not implement any reading feature into jDBexport.
jDBexport in it's versionbranch 4.0 (and later) relies on PhpSpreadsheet as underlying library to create spreadsheets. This library is capable of reading spreadsheets. However we decided to exclude this part of the library from jDBexport and do not implement any reading feature into jDBexport.


There are numerous issues (including security) when allowing imports/update/inserts through Excel documents (or CSV files):

To name a few:
  • Overwrite existing data or not
  • Which table to insert into - do you ask or do you use the sheet name and "guess"
  • If a table doesn't exist, should we create it?
  • what about column headers/extra info - how to handle those
  • Blank lines, should they be imported or not
  • For tables with auto-increment fields, if you defined the auto increment field in your spreadsheet - then you would have to drop the table and recreate it in MySQL to be able to get the IDs inserted as you wanted
  • If you have to drop a table, then you have to rebuild it with all fields/types/indexes as well as foreign keys. That can be close to impossible to do automatically. You have to turn off foreign keys, checking and import/create the new data then turn the foreign keys on again and hope things match up. If you have made a mistake then you can't turn on the foreign keys again and the data integrity is not guaranteed.
  • ...


There are tons of issues with building a generic upload functionality as you can see. You could get it to work if users understood and followed certain guidelines. But the risk of the user making a mistake is enormous, if you put something like this into the hands of the average Joomla user (just imagine the potential chaos, if you would allow some of your users to fully access PhpMyAdmin from the frontend of your website).

To make something decent you have to write a lot of code which checks an awful lot of things and try to prevent various mistakes. The potential support burden and liability is enough reason for us to NOT do this...

Kind regards
Ruediger Schultz

Ruediger Schultz
Schultz IT Solutions

Please support jDBexport on JOOMLA Extension directory (JED) at
extensions.joomla.org/extensions/extensi...ta-reports/jdbexport
The topic has been locked.