? ? Success

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
29 Oct 2013

It would be nice if Joomla! would support the installation on SQLite databases.

This will make the SQLite driver selectable and contains some required modifications.

Note that the installation code has not been touched ('cause it changes oh so quickly 😉), so you will get a somewhat rough "development experience" on installation:

  • Choose SQLite in "Database Type"
  • set a "Username" and "Password" even if those are not required..
  • The "Database Name" must be the absolute path to you database file and has to be no longer than 64 chars....

This should be improved in future versions.
Some more information and thinking is in the readme file, some of them have already been implemented in the sqlite branch.

Note If you are using PHP 5.4 you can run the Joomla! CMS with pure PHP - NO HTTP server and NO database server.

$ cd path/to/repo
$ php -S localhost:8000

http://localhost:8000

See also:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32466&start=0

avatar elkuku elkuku - open - 29 Oct 2013
avatar mbabker
mbabker - comment - 29 Oct 2013

If you're feeling froggy, the Smart Search indexer now uses driver specific classes for the databases. We'll need it sooner or later.

avatar elkuku
elkuku - comment - 30 Oct 2013

@mbabker actually I feel kind of froggy about the finder thingy - whatever that means to you :smile:

Today I learned, that SQLite does not support:

  • Table aliases in update statements.
  • Joins in update statements.
  • A MD5() function.
  • The SOUNDEX() function (per default).

All of which makes the task of writing the FinderIndexerDriverSqlite a bit tricky... but not impossible (I hope)..
If somebody with more knowledge than me could jump in here, that would be cool ;)

But thanks for pointing me to those classes. I was not aware of their existence.

avatar mbabker
mbabker - comment - 30 Oct 2013

You should be able to use the PHP functions for the MD5 and SOUNDEX piece. Performance wise, it won't be the same, but it should do the job at least.

PostgreSQL doesn't support UPDATE JOIN either, but we have a workaround in its query class for that.

Which leaves the last concern, table aliases. That'll be an interesting one to think about.

avatar pascalfree
pascalfree - comment - 10 Feb 2014

I'm looking forward, to see this happen.

I've tried to install the current sqlite__clean branch by downloading the zip and uploading the contents to my server. But couldn't get past the joomla installation. The database configuration page only offers me two options: mysql and mysqli.

Then I tried to set $dbtype = 'sqlite' in the configuration.php file, where I also set an arbitrary username and password. Now the installation page shows the username and password that I've set, but still no option for sqlite.
Is this a known issue? Is there a workaround?
Edit: I found the problem. Apparently my server PDO only supports SQLite2 while SQLite3 is needed.
On the php info page (phpinfo()) under PDO drivers I found that sqlite2 means sqlite2 (obviously), but oddly sqlite stands for sqlite3 (which is missing in my phpinfo).
I just wrote it down here, in case anybody else has the same issue.

I haven't developed in joomla before. I think I will have a look on how the installation application works and eventually fix the problem.

Thank you for working on this.

avatar asika32764
asika32764 - comment - 11 Feb 2014

:+1: Looking forward to this feature.

avatar elkuku
elkuku - comment - 12 Feb 2014

@pascalfree You mean you solved it ?
I would have guessed that the extension is missing. It should be installed by default since PHP 5, but appearently not every distro follows this...
I recently set up a box with debian stable (PHP 5.4.4) where it was not included, so I had to install it using apt-get install php5-sqlite - same might go for Ubuntu (not sure).
About sqlite2: I believe it should be supported (but I wouldn't recommend it) - maybe you can try a hack and modify installation/model/forms/database.xml and add sqlite2 to the list of supported drivers (just a guess)

I just tried, and it still works... just be sure to specify the full path to your database file in the name field during installation - host and username fields are irrelevant !!

The sql file probably needs an update (BTW: it is created using an experimental script xml2sql

Thanks for testing :wink:

avatar pascalfree
pascalfree - comment - 12 Feb 2014

@elkuku Not exactly solved, but at least I know now, that the problem is not in the software but on the server (once more) ;-)
I contacted my hoster, but they couldn't (or wouldn't) change the configuration.

I then tried to install this on a local server (which uses php5.4 with sqlite3) and it worked. As you said, the full path must be in the name. I guess the readme should be updated on that.
I haven't tested anything past the installation yet.

Also, I tried the hack you suggested. Additionally the following modifications may be needed:

  • In the isSupported() Method check for sqlite2 instead of sqlite.
  • set $this->options['version']=2;. The PDO class will use it to connect to the database. It's not working yet, but I will try to fix it. I will post an update if I get it working.

Thanks for your help

EDIT: It's not working, but it will install. I did the following modifications (additionally).

  • driver/sqlite.php in line 264: The bind was not working (:type appeared in the query). so I removed it and put $type directly into the where clause
  • sqlite2 does not seem to support these SQL-clause
    • IF NOT EXISTS
    • AUTOINCREMENT
    • Also it can't handle "`" around names.

This makes it very hard to support sqlite2. I just removed everything unsupported from the sql, to see if I could get at least through the installation process without an error. It worked, but obviously the database can not be set up correctly like that, so I can not login to the admin panel and the front page errors right away. I don't think it's worth the effort to support such old technology, which will hopefully be updated anyway. Ironically, my webserver has sqlite3 installed, but not the corresponding PDO driver.

I just wrote it all down here, so others don't have to walk the same path again. If anybody is interested in actually implementing the sqlite2 support, please let me know. ;-)

avatar elkuku
elkuku - comment - 15 Feb 2014

@pascalfree Sorry I didn't read your edits - quite interesting, thanks for sharing.
Probably not worth making any effort to support SQLite 2 :wink:

avatar elkuku
elkuku - comment - 15 Jun 2014

BTW: the script XML2SQL that is used here to automagically generate the install SQL file has been updated to use Composer :wink:

avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
Build .
avatar brianteeman brianteeman - change - 2 Sep 2014
Category SQL
avatar roland-d
roland-d - comment - 30 Mar 2015

@elkuku Thank you for your contribution, the Production Leadership Team has decided to include your feature.

Since this is already an old request, could you please create a new pull request against the current staging branch, so we can test it?

avatar roland-d
roland-d - comment - 2 May 2015

Unfortunately there has been no reply for over a month. I am going to close this PR. Feel free to create a new PR when ready. Thank you for your contribution.

avatar roland-d roland-d - change - 2 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-02 18:34:08
Closed_By roland-d
avatar roland-d roland-d - change - 2 May 2015
Title
Add support for SQLite databases
[#32466] Add support for SQLite databases
avatar roland-d roland-d - close - 2 May 2015
avatar joomla-cms-bot joomla-cms-bot - close - 2 May 2015
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2015
Title
[#32466] Add support for SQLite databases
Add support for SQLite databases
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2015
Title
Add support for SQLite databases
[#32466] Add support for SQLite databases
avatar brianteeman
brianteeman - comment - 18 Oct 2018

it would be great if this could be revived for joomla 4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/2367.

avatar brianteeman
brianteeman - comment - 18 Oct 2018

it would be great if this could be revived for joomla 4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/2367.

Add a Comment

Login with GitHub to post a comment