invidious/queries.go (view raw)
1package invidious
2
3const createQueryVideos = `
4CREATE TABLE IF NOT EXISTS videos (
5 videoId TEXT PRIMARY KEY,
6 title TEXT NOT NULL,
7 description TEXT NOT NULL,
8 uploader TEXT NOT NULL,
9 duration int NOT NULL,
10 url TEXT NOT NULL,
11 timestamp DATETIME DEFAULT (datetime('now')),
12 expire DATETIME NOT NULL
13);`
14
15const getVideoQuery = "SELECT * FROM videos WHERE videoId = (?);"
16
17const cacheVideoQuery = "INSERT OR REPLACE INTO videos (videoId, title, description, uploader, duration, url, expire) VALUES (?, ?, ?, ?, ?, ?, ?);"
18
19const clearQuery = "DELETE FROM videos;"