Banshee
the secure PHP framework

Forum

Banshee-6.2 and SQLite3 (php70-pdo)

Jyri Sillanpaa
24 April 2018, 14:05
Hi, I'm trying to get the SQLite3 support working (I converted the DB) but I have run into some errors, first on sqlite3_connection.php I had to add exception: use \SQLite3 as SQLite3;
since the: namespace Banshee\Database;
causes Class 'Banshee\Database\SQLite3' not found error on the browser but then I got hit with this:

Internal errors x
SQLite3::query(): Unable to prepare statement: 1, no such function: UNIX_TIMESTAMP
line 56 in /var/www/banshee/libraries/database/sqlite3_connection.php
SQL query: select value, UNIX_TIMESTAMP(timeout) as timeout from cache where "key"='banshee_settings::last_updated' limit 1
Error message:
SQLite3::query(): Unable to prepare statement: 1, near "limit": syntax error
line 56 in /var/www/banshee/libraries/database/sqlite3_connection.php
SQL query: delete from cache where "key"='banshee_settings::last_updated' limit 1
Error message:
SQLite3::query(): Unable to prepare statement: 1, no such function: UNIX_TIMESTAMP
line 56 in /var/www/banshee/libraries/database/sqlite3_connection.php
SQL query: select value, UNIX_TIMESTAMP(timeout) as timeout from cache where "key"='banshee_settings::last_updated' limit 1

Is the SQLite3 still supported on version 6 or did I just mess something up?
Hugo Leisink
25 April 2018, 00:55
Banshee can use SQLite3 databases, but all the SQL queries are written for MySQL. If you want to use SQLite as the main Banshee database, you must rewrite those queries.
Jyri Sillanpaa
25 April 2018, 12:30
You could say that SuiteCRM can use PostgreSQL database as long as you rewrite the whole code base related to MySQL queries

But thank you, I will use MySQL even if it is a bit overkill for the project.