Jump to content

Databases: Difference between revisions

From Official Kodi Wiki
>Nmrs
No edit summary
mNo edit summary
 
(246 intermediate revisions by 40 users not shown)
Line 1: Line 1:
{{Incomplete}}
{{Template:DatabasesNavBox}}
==XBMC Database Details==
{{mininav| [[Development]] {{l2| [[Userdata]] }} }}
XBMC utilizes [http://www.sqlite.org/ SQLite], an open source light-weight SQL database-engine, to store all its library related data ([[Music Library|Music]], [[Video Library|Video]] and Program databases). By default, the database files (*.db) are stored in [[The UserData Folder]], specifically $HOME\UserData\Database\.


Also XBMC puts a video in it's database if you change any OSD setting while watching, resume points are also stored here.
That is independant of if the video is part of the Video Library or not.


===Accessing the Database via SQLite application===
Database files can be transferred via FTP to a Windows-based computer and edited or analyzed with a SQLite graphical client. XBMC's version of the database engine should be compatible with the standard clients such as [http://sqlitebrowser.sourceforge.net SQLiteBrowser] or [http://bobmanc.home.comcast.net/sqlitecc.html SQLiteCC], (more available management-tools can be found in [http://www.sqlite.org/cvstrac/wiki?p=ManagementTools sqlite.org WIKI]).<br>
We recommend you use [http://www.yunqa.de/delphi/doku.php/products/sqlitespy/index SQLiteSpy version 1.5.2] or higher.
*[[HOW-TO: Use your computer to edit XBMC's (SQL) database-files]].


===Database Structure===
= Introduction =
{| class="wikitable sortable"
<section begin="intro" />Kodi uses [http://www.sqlite.org/ SQLite], an open source light-weight SQL database-engine, to store all the library, add-on, EPG, textures and PVR related data using a number of specific databases.<section end="intro" /> By default, the database files (*.db) are stored in the '''''[[Kodi data folder]]\[[Userdata]]''''' folder, specifically in \Database\.
|+ episode - Stores Television Episode Information
 
! Column Name || Data Type || Description
 
 
= Using the Databases =
The databases are automatically maintained by {{Kodi}}. It is recommended that {{kodi}} users do not access the database without good working knowledge of relational databases and SQL.
 
Database software is required to access the SQL databases. '''[https://sqlitebrowser.org/ DB Browser for SQLite]''' is available for Windows, macOS, Linux and FreeBSD.
 
 
 
= Accessing the Databases with Kodi Python =
Many Python plugins (and some scripts) can use the information in the Kodi database to offer users additional convenience and functionality. The easiest way to access the databases via Kodi Python is using '''[[JSON-RPC API]]'''
 
 
 
= Database Versions =
<section begin="database versions" />The following tables shows what database version is used for various Kodi versions. This can be useful to see what versions of Kodi can use '''[[MySQL]]''' sharing. Note that future release database versions are subject to change during development.
 
{|class="prettytable"
! Kodi version !! Date !! Addons !! EPG !! MyMusic !! MyVideos !! Textures !! TV !! ViewModes !! ADSP
|-
|-
|idEpisode || integer || Primary Key
| style="width:120px;" | v10 - Dharma
| style="width:120px;" | December 2010
| style="width:80px; text-align:center;" | 1
| style="width:60px; text-align:center;" | N/A
| style="width:80px; text-align:center;" | 7
| style="width:80px; text-align:center;" | 37
| style="width:80px; text-align:center;" | 1
| style="width:60px; text-align:center;" | N/A
| style="width:80px; text-align:center;" | 1
| style="width:60px; text-align:center;" | N/A
|-
|-
|c00 || text ||  Episode Title
| style="width:120px;" | v11 - Eden
| style="width:120px;" | March 2012
| style="width:80px; text-align:center;" | 15
| style="width:60px; text-align:center;" | N/A
| style="width:80px; text-align:center;" | 18
| style="width:80px; text-align:center;" | 60
  | style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | N/A
| style="width:80px; text-align:center;" | 4
| style="width:60px; text-align:center;" | N/A
|-
|-
|c01 || text ||  Plot Summary
| style="width:120px;" | v12 - Frodo
| style="width:120px;" | January 2013
| style="width:80px; text-align:center;" | 15
| style="width:60px; text-align:center;" | 7
| style="width:80px; text-align:center;" | 32
| style="width:80px; text-align:center;" | 75
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 22
| style="width:80px; text-align:center;" | 4
| style="width:60px; text-align:center;" | N/A
|-
|-
|c02 || text ||  [unknown]
| style="width:120px;" | v13 - Gotham
| style="width:120px;" | May 2014
| style="width:80px; text-align:center;" | 16
| style="width:60px; text-align:center;" | 7
| style="width:80px; text-align:center;" | 46
| style="width:80px; text-align:center;" | 78
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 22
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | N/A
|-
|-
|c03 || text ||  Rating
| style="width:120px;" | v14 - Helix
| style="width:120px;" | December 2014
| style="width:80px; text-align:center;" | 16
| style="width:60px; text-align:center;" | 8
| style="width:80px; text-align:center;" | 48
| style="width:80px; text-align:center;" | 90
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 26
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | N/A
|-
|-
|c04 || text ||  Writer
| style="width:120px;" | v15 - Isengard
| style="width:120px;" | July 2015
| style="width:80px; text-align:center;" | 19
| style="width:60px; text-align:center;" | 10
| style="width:80px; text-align:center;" | 52
| style="width:80px; text-align:center;" | 93
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 29
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | N/A
|-
|-
|c05 || text ||  First Aired
| style="width:120px;" | v16 - Jarvis
| style="width:120px;" | February 2016
| style="width:80px; text-align:center;" | 20
| style="width:60px; text-align:center;" | 11
| style="width:80px; text-align:center;" | 56
| style="width:80px; text-align:center;" | 99
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 29
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | 0
|-
|-
|c06 || text ||  Thumbnail URL
| style="width:120px;" | v17 - Krypton
| style="width:120px;" | February 2017
| style="width:80px; text-align:center;" | 27
| style="width:60px; text-align:center;" | 11
| style="width:80px; text-align:center;" | 60
| style="width:80px; text-align:center;" | 107
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 29
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | 0
|-
|-
|c07 || text ||  [unknown]
| style="width:120px;" | v18 - Leia
| style="width:120px;" | January 2019
| style="width:80px; text-align:center;" | 27
| style="width:60px; text-align:center;" | 12
| style="width:80px; text-align:center;" | 72
| style="width:80px; text-align:center;" | 116
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 32
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | 0
|-
|-
|c08 || text ||  Has the episode been watched?
| style="width:120px;" | v19 - Matrix
| style="width:120px;" | December 2020
| style="width:80px; text-align:center;" | 33
| style="width:60px; text-align:center;" | 13
| style="width:80px; text-align:center;" | 82
| style="width:80px; text-align:center;" | 119
  | style="width:80px; text-align:center;" | 13
| style="width:60px; text-align:center;" | 38
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | N/A
|-
|-
|c09 || text ||  [unknown]
| style="width:120px;" | v20 - Nexus
| style="width:120px;" | 11 January 2023
| style="width:80px; text-align:center;" | 33
| style="width:60px; text-align:center;" | 16
| style="width:80px; text-align:center;" | 82
| style="width:80px; text-align:center;" | 121
  | style="width:80px; text-align:center;" | 13
| style="width:80px; text-align:center;" | 40
| style="width:80px; text-align:center;" | 6
| style="width:60px; text-align:center;" | N/A
|-
|-
|c10 || text ||  Director
| style="width:120px; background: #a0e75a;" | v21 - Omega
| style="width:120px; background: #a0e75a;" | 2 April 2024
| style="width:80px; text-align:center; background: #a0e75a;" | 33
| style="width:60px; text-align:center; background: #a0e75a;" | 16
| style="width:80px; text-align:center; background: #a0e75a;" | 83
| style="width:80px; text-align:center; background: #a0e75a;" | 131
  | style="width:80px; text-align:center; background: #a0e75a;" | 13
| style="width:80px; text-align:center; background: #a0e75a;" | 44 <small>(v21.0)</small><br/>46 <small>(v21.1)</small>
| style="width:80px; text-align:center; background: #a0e75a;" | 6
| style="width:60px; text-align:center; background: #a0e75a;" | N/A
|-
|-
|c11 || text ||  [unknown]
| style="width:120px; background: skyBlue;" | v22 - Piers
|-
| style="width:120px; background: skyBlue;" | TBD
|c12 || text || Season
| style="width:80px; text-align:center; background: skyBlue;" | 33
|-
  | style="width:60px; text-align:center; background: skyBlue;" | 20
|c13 || text || Episode Number
| style="width:80px; text-align:center; background: skyBlue;" | 83
|-
  | style="width:80px; text-align:center; background: skyBlue;" | 135
|c14 || text || [unknown]
| style="width:80px; text-align:center; background: skyBlue;" | 14
|-
  | style="width:60px; text-align:center; background: skyBlue;" | 47
|c15 || text || [unknown]
| style="width:80px; text-align:center; background: skyBlue;" | 6
|-
  | style="width:60px; text-align:center; background: skyBlue;" | N/A
|c16 || text ||  [unknown]
|}
|-
 
|c17 || text ||  [unknown]
{| class="prettytable"
|-
|-
|c18 || text ||  [unknown]
! colspan="2"| Legend
|-
|-
|c19 || text ||  [unknown]
| style="background:#a0e75a;"| Green
| Current release
|-
|-
|c20 || text ||  [unknown]
| style="background:skyBlue;"| Blue
|-
| Future release
|idFle || integer ||  Foreign key to the file for this episode
|}
|}
<section end="database versions" />
= See also =
* [[Releases]]
* https://github.com/xbmc/xbmc/commits/master/xbmc/video/VideoDatabase.cpp - Tracking the Video Database schema version
* https://github.com/xbmc/xbmc/commits/master/xbmc/music/MusicDatabase.cpp - Tracking the Music Database schema version


-------------


{| class="wikitable sortable"
|+ tvshow - Stores Television Show Information
! Column Name || Data Type || Description
|-
|idShow || integer || Primary Key
|-
|c00 || text ||  Show Title
|-
|c01 || text || Show Summary
|-
|c02 || text ||  [unknown]
|-
|c03 || text ||  [unknown]
|-
|c04 || text ||  Rating
|-
|c05 || text ||  First Aired
|-
|c06 || text ||  Thumbnail URL
|-
|c07 || text ||  [unknown]
|-
|c08 || text ||  Genre
|-
|c09 || text ||  [unknown]
|-
|c10 || text ||  Episode Guide URL
|-
|c11 || text ||  Fan Art URL
|-
|c12 || text ||  [unknown]
|-
|c13 || text ||  [unknown]
|-
|c14 || text ||  [unknown]
|-
|c15 || text ||  [unknown]
|-
|c16 || text ||  [unknown]
|-
|c17 || text ||  [unknown]
|-
|c18 || text ||  [unknown]
|-
|c19 || text ||  [unknown]
|-
|c20 || text ||  [unknown]
|}


-------------


{| class="wikitable sortable"
|+ tvshowlinkepisode - Linker table to join TV Shows and Episodes
! Column Name || Data Type || Description
|-
|idShow || integer || Foreign Key to tvshow table
|-
|idEpisode || integer || Foreign Key to episode table
|}


===TO-DO (what needs to be added to this database article)===
{{Top}}
*The layout, etc. will be explained in more detail here later.
{{updated|22}}


[[Category:Inner Workings]]
[[Category:PVR]]
[[category:Development]]
[[Category:Add-ons]]
[[Category:To-Do]]
[[Category:Karellen]]
[[category:Library]]
[[Category:Development]]
[[category:Video Library]]
[[Category:Video library]]
[[category:Music Library]]
[[Category:Music library]]
[[Category:Skin_development]]

Latest revision as of 10:08, 28 April 2025

Kodi Databases

See also:

  ▶ Development
▶ Userdata
▶ Databases


Introduction

Kodi uses SQLite, an open source light-weight SQL database-engine, to store all the library, add-on, EPG, textures and PVR related data using a number of specific databases. By default, the database files (*.db) are stored in the Kodi data folder\Userdata folder, specifically in \Database\.


Using the Databases

The databases are automatically maintained by Kodi. It is recommended that Kodi users do not access the database without good working knowledge of relational databases and SQL.

Database software is required to access the SQL databases. DB Browser for SQLite is available for Windows, macOS, Linux and FreeBSD.


Accessing the Databases with Kodi Python

Many Python plugins (and some scripts) can use the information in the Kodi database to offer users additional convenience and functionality. The easiest way to access the databases via Kodi Python is using JSON-RPC API


Database Versions

The following tables shows what database version is used for various Kodi versions. This can be useful to see what versions of Kodi can use MySQL sharing. Note that future release database versions are subject to change during development.

Kodi version Date Addons EPG MyMusic MyVideos Textures TV ViewModes ADSP
v10 - Dharma December 2010 1 N/A 7 37 1 N/A 1 N/A
v11 - Eden March 2012 15 N/A 18 60 6 N/A 4 N/A
v12 - Frodo January 2013 15 7 32 75 13 22 4 N/A
v13 - Gotham May 2014 16 7 46 78 13 22 6 N/A
v14 - Helix December 2014 16 8 48 90 13 26 6 N/A
v15 - Isengard July 2015 19 10 52 93 13 29 6 N/A
v16 - Jarvis February 2016 20 11 56 99 13 29 6 0
v17 - Krypton February 2017 27 11 60 107 13 29 6 0
v18 - Leia January 2019 27 12 72 116 13 32 6 0
v19 - Matrix December 2020 33 13 82 119 13 38 6 N/A
v20 - Nexus 11 January 2023 33 16 82 121 13 40 6 N/A
v21 - Omega 2 April 2024 33 16 83 131 13 44 (v21.0)
46 (v21.1)
6 N/A
v22 - Piers TBD 33 20 83 135 14 47 6 N/A
Legend
Green Current release
Blue Future release


See also



Return to top