1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-21 17:45:29 +01:00
3 Database
Stypox edited this page 2022-03-27 09:52:16 +02:00

This page is in an early state and not yet completed or reviewed!

This pages gives some information on the internal app database. In short, you learn about the database structure and how to modify it as well as how to access the stored data.

Database structure

NewPipe is a streaming frontend. For this reason, storing information on streams is the database's core functionality.
Basically, stream information is used for feeds, playlists and watch history.

NewPipe's database structure

How to update this diagram?

Use https://dbeaver.io/ (FOSS)

Modifying the database structure

When modifying the database structure, the database version needs to be increased.
You also need to create a migration to update the structure on installations which run an old database version. This is done in the Migrations class. After creating the migration, it needs to be registered with the database to be executed if necessary.

Access data

Add some info on the DAO pattern here; AppDatabase and NewPipeDatabase