I've been playing around with Drupal6 using SQLite database layer, as per this page.
http://coolsoft.altervista.org/en/drupal-sqlite

I found that the ctools file includes/css.inc invokes SQL TRUNCATE command, which is not supported by SQLite, so I added a conditional statement to check for database type:

/**
 * Delegated implementation of hook_flush_caches()
 */
function ctools_css_flush_caches() {
  global $db_type;
  file_scan_directory(file_create_path('ctools/css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
  if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'pgsql' ) {
    db_query("TRUNCATE {ctools_css_cache}");
  }
  elseif ($db_type == 'sqlite') {
    db_query("DELETE FROM {ctools_css_cache}");
  }
}

Please respond if you would like for me to create patch against the HEAD version of ctools. AFAIK, SQLite support is already planned for D7, but this could be useful for backporting.

Comments

merlinofchaos’s picture

DELETE FROM is supported by all databases, so it would be preferable to use that rather than have a conditional in there. I can accept that patch.

merlinofchaos’s picture

Status: Active » Fixed

Fixed in -dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.