feat(tvldb): Import the tvldb/paroxysm source, add a Nix derivation
- This imports the tvldb (actually a thing called 'paroxysm') code from https://git.theta.eu.org/eta/paroxysm into the monorepo. - Additionally, I did a nix thing, yay! \o/ (well, with tazjin's help) - 3p/default.nix needed modifying to whitelist pgsql. Change-Id: Icdf13ca221650dde376f632bd2dd8a087af451bf Reviewed-on: https://cl.tvl.fyi/c/depot/+/389 Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
4c22cf3169
commit
c3abbb5e2d
17 changed files with 2315 additions and 0 deletions
33
fun/tvldb/src/models.rs
Normal file
33
fun/tvldb/src/models.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use crate::schema::{entries, keywords};
|
||||
use chrono::NaiveDateTime;
|
||||
|
||||
#[derive(Queryable)]
|
||||
pub struct Keyword {
|
||||
pub id: i32,
|
||||
pub name: String,
|
||||
pub chan: String,
|
||||
}
|
||||
#[derive(Queryable)]
|
||||
pub struct Entry {
|
||||
pub id: i32,
|
||||
pub keyword_id: i32,
|
||||
pub idx: i32,
|
||||
pub text: String,
|
||||
pub creation_ts: NaiveDateTime,
|
||||
pub created_by: String,
|
||||
}
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "keywords"]
|
||||
pub struct NewKeyword<'a> {
|
||||
pub name: &'a str,
|
||||
pub chan: &'a str,
|
||||
}
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "entries"]
|
||||
pub struct NewEntry<'a> {
|
||||
pub keyword_id: i32,
|
||||
pub idx: i32,
|
||||
pub text: &'a str,
|
||||
pub creation_ts: NaiveDateTime,
|
||||
pub created_by: &'a str,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue