DB Manager for PDO-SQLite on WordPress

in a recent project i have been finding the need to address the database directly (to hack some plugins). There are plugins available to do this for mysql (enabling PHPMyAdmin). There is a similar application for sqlite called SQLiteMyAdmin. But personally I hate it.
So I am adapting my CRUD application to use PDO and will make this into a WP plugin so that users can address their databases directly (on their own head be it…)
Should be available soon.

8 Comments

BertrandBJune 6th, 2009 at 8:34 am

Personnaly i use sqlitemanager wich have a mysql compatibility mode for sql.
I t’s quite good

JustinJune 6th, 2009 at 1:32 pm

@BertrandB
howdy, i’ll check out sqlitemanager and if it looks will good, will integrate it. thanks for the heads up.

This is part of a larger effort to bring the plugin more into the mainstream and implementing autoupgrade etc. i _really_ want to get dbdelta() to play nicely with sqlite too.

I’m also working on postgres and sqlserver drivers. so if luck holds there will be a version 3 release sometime this year…

meantime i have finally fixed the date permalink issue with help from a user. version 2.7.0 will be posted in the next few days (am just working on fixing the import feature for another user).

andyJuly 12th, 2009 at 4:24 am

Howdy.
I didn’t try SQLite. Is it similiar to http://code.google.com/p/wordpress-mssql/?
I downloaded db.php and manage to install databse to MSSQL 2008 and running WordPress 2.7.1
I had to change core 2.7.1 for MSSQL query to work and changed wp_links table scheme (datetime default value).

I wish wordpress support every kinds of database.

Thanks,

AshishSeptember 8th, 2009 at 7:09 pm

Hello,
For me, the pdo-plugin isn’t working. I edited the wp-config.php to add this line:
define(‘DB_TYPE’, ‘sqlite’), and copied the contents of the directory pdo-for-wordpress to wp-content. After that I set the permissions of 755 on the complete wordpress directory recursively. Then I tried to access wp-admin/install.php, but the browser was blank. Then I changed the permission of wp-content directory to 777, but still no luck. Then I manually ran the wp-admin/install.php on command line, using php wp-admin/install.php, this seems to have created a directory database inside wp-content with permissions 777, and inside that an sqlite db, which had 755 permissions. Then I tried to run the installation using browser, and was greeted by the installation page, but after entering the name of my blog, and the email address, I get an unreadable database error. I changed the permission of the sqlite database to 777, but the error persists.

wp-content: 777
wp-content/database: 777
wp-content/database/MyBlog.sqlite: 777

The error is:

Queries made or created this session were

1. Raw query: INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
2. Rewritten: INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
3. With Placeholders: INSERT INTO wp_options (option_name,option_value,autoload) VALUES ( ? , ? , ? )
4. Prepare: INSERT INTO wp_options (option_name,option_value,autoload) VALUES ( ? , ? , ? )
5. Executing: Array ( [0] => _transient_random_seed [1] => c841e4e85e7e8983c58505d04b6a0f87 [2] => yes )

Error occurred at line 459 in Function executeQuery.
Error message was: Error executing query. Error was was attempt to write a readonly database

PDO_Engine Object
(
[isError] =>
[foundRowsResult] =>
[initialQuery:private] => INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
[rewrittenQuery:private] => INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
[queryType:private] => insert
[rewriteEngine:private] => pdo_sqlite_driver Object
(
[ifStatements:private] => Array
(
)

[startingQuery:private] => INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
[_query] => INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
[dateRewrites:private] => Array
(
)

[queryType] => insert
)

[needsPostProcessing:private] => 1
[results:private] => Array
(
)

[pdo:private] => PDO Object
(
)

[preparedQuery:private] => INSERT INTO wp_options (option_name,option_value,autoload) VALUES ( ? , ? , ? )
[extractedVariables:private] => Array
(
[0] => _transient_random_seed
[1] => c841e4e85e7e8983c58505d04b6a0f87
[2] => yes
)

[errorMessages:private] => Array
(
)

[errors:private] => Array
(
[0] => Array
(
[line] => 459
[function] => executeQuery
)

)

[queries] => Array
(
[0] => Raw query: INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
[1] => Rewritten: INSERT INTO wp_options (option_name,option_value,autoload) VALUES (‘_transient_random_seed’,’c841e4e85e7e8983c58505d04b6a0f87′,’yes’)
[2] => With Placeholders: INSERT INTO wp_options (option_name,option_value,autoload) VALUES ( ? , ? , ? )
[3] => Prepare: INSERT INTO wp_options (option_name,option_value,autoload) VALUES ( ? , ? , ? )
[4] => Executing: Array
(
[0] => _transient_random_seed
[1] => c841e4e85e7e8983c58505d04b6a0f87
[2] => yes
)

)

[dbType:private] => sqlite
[lastInsertID:private] =>
[affectedRows:private] =>
[columnNames:private] => Array
(
)

[numRows:private] =>
[returnValue:private] =>
[startTime:private] =>
[stopTime:private] =>
[_results] => Array
(
)

[statement] => PDOStatement Object
(
[queryString] => INSERT INTO wp_options (option_name,option_value,autoload) VALUES ( ? , ? , ? )
)

)

I would be grateful if you could help.

wellbugSeptember 13th, 2009 at 3:49 pm

how to install the wordpress(sqlite) in Mac OSX. Use XAMPP.
Warning: fopen(/Users/kids/Sites//wp-content/database//.htaccess) [function.fopen]: failed to open stream: No such file or directory in /Users/kids/Sites/wp-content/pdo/PDOEngine.php on line 87
………………..
Thank you very much!
(sorry….my english so poor -_-)

VicDecember 13th, 2009 at 8:04 pm

The plugin simply doesn’t work. After installation and configuration WP is still trying to access MySql instead of Sqlite.
I have used the latest development version of WP, 2.9

DB Manager for PDO-SQLite on WordPress is a vaporware.

JustinDecember 13th, 2009 at 10:37 pm

@Vic
i have not published a DB Manager for PDO-SQLite. it remains in development so in a sense you are right, it is currently vapourware.

however I believe that you are referring to PDO for WordPress. This is far from vapourware and there are many thousands of active users. However you should not that it is not yet compatible with wp 2.9 or 2.8. it should be easy to bring compatibility up to date but I currently do not have the time. Feel free to code a solution yourself and submit it back to the community.

VicDecember 19th, 2009 at 10:35 pm

Hello Justing. Sorry if I posted this in the wrong place.
I just noticed that there have been users that also had problems and there was no response, that was part of the reason I said it was “vapourware”.
Anyway, I tried version 2.8 and it seemed to work, I then upgraded to latest stable and it still worked but there were errors. I would be more than happy to help bring the compatibility up to date, and I know it is easy for you. I just learned PHP, have limited source code reading skills. It will probably take me several months to do it. I can try it anyway if you give me some pointers where I should start and what I need to look for.
Thanks for the great plugin.

Leave a comment

Your comment