Readme

This val is part of the SteamPlaytimeHistory project

This val exports the drizzle table scheme so you can use it to interact with your play_history table across your differents vals

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { sqlite } from "https://esm.town/v/std/sqlite";
import { sql } from "npm:drizzle-orm";
import { drizzle } from "npm:drizzle-orm/libsql";
import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";
const db = drizzle(sqlite as any);
const play_history = sqliteTable("play_history", {
id: integer("id").primaryKey(),
date: text("date").default(sql`(CURRENT_TIMESTAMP)`).notNull(),
appid: integer("appid").notNull(),
name: text("name").notNull(),
playtime_2weeks: integer("playtime_2weeks").notNull(),
playtime_forever: integer("playtime_forever").notNull(),
img_icon_url: text("img_icon_url").notNull(),
playtime_windows_forever: integer("playtime_windows_forever").notNull(),
playtime_mac_forever: integer("playtime_mac_forever").notNull(),
playtime_linux_forever: integer("playtime_linux_forever").notNull(),
playtime_deck_forever: integer("playtime_deck_forever").notNull(),
});
export { db, play_history };
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v2
May 30, 2024