Learn some basic algorithms via

https://github.com/trekhleb/javascript-algorithms?tab=readme-ov-file
super cool repo! This algorithm will just run on the client, if it isn't
my server will blow up :( Maybe I will just make a postgres db that
sends the users processing info to save other users processing power?
This commit is contained in:
yuanhau 2025-05-19 13:59:10 +08:00
parent 2f2b4b1d19
commit edd8e5b05a
13 changed files with 127 additions and 462 deletions

View file

@ -1,15 +1,26 @@
import sql from "~/server/components/postgres";
const createUsers = await sql`
create table if not exists users (
uuid text primary key,
created_at timestamptz default current_timestamp,
username text not null unique,
avatarurl text not null,
firstname text not null,
passwordhash text not null,
email text not null
);
create table if not exists users (
uuid text primary key,
created_at timestamptz default current_timestamp,
username text not null unique,
avatarurl text,
firstname text,
passwordhash text not null,
email text
);
`;
const usersList = await sql`
create table if not exists usertokens (
token text not null primary key,
created_at timestamptz default current_timestamp,
username text not null,
email text,
avatarurl text,
firstname text
)
`;
const createNewsProviders = await sql`