[mythtv-commits] Ticket #6060: Add SQL_QUERY command to protocol for running mysql queries
MythTV
mythtv at cvs.mythtv.org
Sat Jan 3 04:30:57 UTC 2009
#6060: Add SQL_QUERY command to protocol for running mysql queries
------------------------------------+---------------------------------------
Reporter: lpgcritter at nasquan.com | Owner: ijr
Type: enhancement | Status: new
Priority: minor | Milestone: 0.22
Component: mythtv | Version: unknown
Severity: medium | Mlocked: 0
------------------------------------+---------------------------------------
There are currently a lot of operations that can't be done by a custom
frontend without directly accessing the MYSQL database. This means that
any custom frontend will need a dependency on mysql client libraries. It
also means that the mysql server will need to be reconfigured to listen on
the network interface.
I propose that a SQL_QUERY command be added to the mythtv protocol that
can execute SQL and receive results from the mythtv database.
Example:
{{{
SELECT * FROM recordedseek WHERE chanid=1003 AND starttime='2008-11-17
21:00:00' LIMIT 3;
+--------+---------------------+------+--------+------+
| chanid | starttime | mark | offset | type |
+--------+---------------------+------+--------+------+
| 1003 | 2008-11-17 21:00:00 | 0 | 376 | 9 |
| 1003 | 2008-11-17 21:00:00 | 12 | 356072 | 9 |
| 1003 | 2008-11-17 21:00:00 | 24 | 708760 | 9 |
+--------+---------------------+------+--------+------+
}}}
Frontend sends
{{{
SQL_QUERY[]:[]SELECT * FROM recordedseek WHERE chanid=1003 AND
starttime='2008-11-17 21:00:00' LIMIT 3
}}}
Backend sends
{{{
3[]:[]1003[]:[]2008-11-17
21:00:00[]:[]0[]:[]376[]:[]9[]:[]1003[]:[]2008-11-17
21:00:00[]:[]12[]:[]356072[]:[]9[]:[]1003[]:[]2008-11-17
21:00:00[]:[]24[]:[]708760[]:[]9
}}}
The first param is the number of rows, the subsequent params are the row
data.
For INSERT, UPDATE, DELETE, the result will only have one param and that
is the number of rows affected.
On error it sends
{{{
-1[]:[]Error message here
}}}
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/6060>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list