Loading...
Loading...
Use this skill when you need to execute SQL against the MoviePilot database. This skill guides you through connecting to the database and executing SQL statements. The database type (SQLite or PostgreSQL) and connection details are provided in the system prompt <system_info>. Applicable scenarios include: 1) The user asks about data statistics, counts, or aggregations that existing tools don't cover; 2) The user wants to inspect, modify, or fix raw database records; 3) The user asks to clean up data, update records, or perform database maintenance; 4) The user asks questions like "how many downloads", "show me site stats", "delete old records", etc.
npx skill4agent add jxxghp/moviepilot database-operationexecute_command<system_info>sqlitepostgresqlSQLite (/config/db/moviepilot.db)PostgreSQL (user:password@host:port/database)<system_info><system_info>SQLiteexecute_commandsqlite3 -header -column <DB_PATH> "YOUR SQL QUERY HERE;"sqlite3 -json <DB_PATH> "YOUR SQL QUERY HERE;"sqlite3 -header -column <DB_PATH> "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"sqlite3 <DB_PATH> ".schema tablename"<system_info>user:password@host:port/databasePostgreSQLexecute_commandpsqlPGPASSWORD=<password> psql -h <host> -p <port> -U <user> -d <database> -c "YOUR SQL QUERY HERE;"PGPASSWORD=<password> psql -h <host> -p <port> -U <user> -d <database> -c "SELECT tablename FROM pg_tables WHERE schemaname='public' ORDER BY tablename;"PGPASSWORD=<password> psql -h <host> -p <port> -U <user> -d <database> -c "\d tablename"idpathtypetitleyeartmdbidimdbiddoubanidseasonsepisodesdownloaderdownload_hashtorrent_nametorrent_siteuseridusernamedatemedia_categoryiddownloaderdownload_hashfullpathsavepathfilepathtorrentnamestateidsrcdestmodetypecategorytitleyeartmdbidseasonsepisodesdownload_hashstatuserrmsgdateidnameyeartypetmdbiddoubanidseasontotal_episodestart_episodelack_episodestatefilterincludeexcludequalityresolutionsitesbest_versiondateusernameidnameyeartypetmdbiddoubanidseasontotal_episodestart_episodedateusernameidnameemailis_activeis_superuserpermissionssettingsidnamedomainurlpricookieproxyis_activedownloaderlimit_intervallimit_countiddomainnameusernameuser_levelbonusuploaddownloadratioseedingleechingseeding_sizeupdated_dayiddomainsuccessfailsecondslst_statelst_mod_dateidserverlibraryitem_iditem_typetitleoriginal_titleyeartmdbidimdbidtvdbidpathidkeyvalueidusernamekeyvalueidplugin_idkeyvalueidchannelsourcemtypetitletextimagelinkuseridreg_timeidnamedescriptiontimertrigger_typeevent_typestaterun_countactionsflowslast_timeiduser_idcredential_idpublic_keynamecreated_atlast_used_atis_activeidnamedomainurlbase64SELECT COUNT(*) AS total FROM downloadhistory;SELECT title, year, type, torrent_site, date FROM downloadhistory ORDER BY id DESC LIMIT 10;SELECT id, title, src, errmsg, date FROM transferhistory WHERE status = 0 ORDER BY id DESC LIMIT 10;SELECT name, year, type, season, state, lack_episode FROM subscribe WHERE state = 'R';SELECT name, domain, upload, download, ratio, bonus, seeding, user_level FROM siteuserdata ORDER BY upload DESC;SELECT server, library, COUNT(*) AS count FROM mediaserveritem GROUP BY server, library;SELECT domain, success, fail, ROUND(success * 100.0 / (success + fail), 1) AS success_rate FROM sitestatistic WHERE success + fail > 0 ORDER BY success_rate DESC;SELECT plugin_id, key FROM plugindata ORDER BY plugin_id, key;DELETE FROM downloadhistory WHERE date < '2024-01-01';UPDATE subscribe SET state = 'S' WHERE id = 123;DELETE FROM transferhistory WHERE status = 0 AND date < '2024-06-01';INSERTUPDATEDELETEDROPALTERTRUNCATESELECTDELETEDROPTRUNCATE.dumppg_dumpUPDATEDELETEWHERESELECTLIMITsitecookieapikeytoken'***'userhashed_passwordotp_secret| Feature | SQLite | PostgreSQL |
|---|---|---|
| Boolean values | | |
| String concat | | |
| Current time | | |
| LIMIT syntax | | |
| JSON access | | |
| Case sensitivity | Case-insensitive by default | Case-sensitive |
| LIKE | Case-insensitive | Use |
sqlite3python3 -c "import sqlite3; ..."psqlpython3 -c "import psycopg2; ..."