Hi,
I'm using limesurvey as offline data input component, and sqlite works quite well (after few code modifications) in these circumstances. Although, I'm not entirely sure, if my modifications don't break something important, that I cannot find.
Main problem is (apart from limited ALTER TABLE support in sqlite, which I worked around in quite unelegant way, quoted below) sqlite's lack of RIGHT JOIN support. RIGHT JOIN appears in LS2 code four times (once in activate_helper.php, twice in frontend_helper.php, and once in user.php), but from database structure and query syntax I cannot understand if this need to be right join neccesarily. At the moment I simply substituted RIGHT JOIN with LEFT OUTER JOIN, tested everything from installation to import of new survey to data input to limesurvey update, and don't encountered (apart from when debug=2) any strange nor undesirable behavior.
If anyone is interested in going with this direction, I can prepare diff from Build 130305 for working sqlite support after some cleaning.
The workaround code for yii framework is:
public function alterColumn($table, $column, $type)
{
//
// This is dangerous as hell and should never be used in production - better
// approach would be creating new table and moving all data.
//
$table = $this->loadTable($table);
$columns = Array();
foreach ($table->columns as $col)
{
$columns[$col->name] = $col->dbType;
}
$cmd = "PRAGMA writable_schema = 1;\n";
$tablename = $this->getDBConnection()->tablePrefix.str_replace(array('{{','}}'),'',$table->name);
$columns[$column] = $type;
$cmd .= "UPDATE SQLITE_MASTER SET SQL = ".
$this->getDBConnection()->quoteValue($this->createTable($tablename, $columns))
. " WHERE type = [table] and name = "
. $this->getDBConnection()->quoteTableName($tablename) . ";\n";
$cmd .= "PRAGMA writable_schema = 1;\n";
$cmd .= "VACUUM;\n";
return $cmd;
// throw new CDbException(Yii::t('yii', 'Altering a DB column is not supported by SQLite.'));
}and some minor column name and table name quoting fixes. I fully understand, that this approach is dangerous, and shouldn't be used at all - yet it works