This commit is contained in:
Elijah McMorris 2024-02-16 04:30:40 -08:00
parent 6fb3d2bdbe
commit 0779aa6199
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
8 changed files with 192 additions and 8 deletions

19
src/app/stats/db.tsx Normal file
View file

@ -0,0 +1,19 @@
"use server";
import { initConnection } from "@/components/db-utils";
export async function querydb() {
try {
let db = await initConnection();
let stats = await db.query(`
select * from url
order by clicks desc
limit 50;
`);
// @ts-ignore
console.log(stats);
return stats;
} catch (e) {
return;
}
}