This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Amarok 2 script MySQLe access

Tags: None
(comma "," separated)
kk7
Registered Member
Posts
6
Karma
0

Amarok 2 script MySQLe access

Thu Oct 23, 2008 9:59 pm
oke Amarok2 is now based on mysql embedded... fine... but is it still possible to access the database directly in a script?
something like...
Code: Select all
db = QSqlDatabase.addDatabase( "QMYSQLE");


...would be nice but this driver doesn't seem to exist -.- any workaround proposals?
User avatar
sebr
Moderator
Posts
301
Karma
0

Re: Amarok 2 script MySQLe access

Tue Oct 28, 2008 12:03 am
From the script manager, use:

sql = Amarok.collection.escape( "SELECT columns FROM tables" )
results = Amarok.Collection.query ( sql )

You won't be able to gain direct access to the MySQL-embedded database as it does not accept connections on the standard mysql socket.
kk7
Registered Member
Posts
6
Karma
0

Re: Amarok 2 script MySQLe access

Thu Oct 30, 2008 8:33 am
thx, it solves my problem! It even seems to be faster than with sqllite...  :cool:
Boni
Registered Member
Posts
49
Karma
0

Re: Amarok 2 script MySQLe access

Wed Nov 26, 2008 11:25 am
ReferenceError: escape is not defined ...?
I'm trying to manipulate the database because of some reasons and I didn't found a way to connect to the database...
User avatar
sebr
Moderator
Posts
301
Karma
0

Re: Amarok 2 script MySQLe access

Wed Nov 26, 2008 11:37 am
There was a typo in my post. use Amarok.Collection.escape()  notice the upper case C


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]