stats
This commit is contained in:
parent
6fb3d2bdbe
commit
0779aa6199
8 changed files with 192 additions and 8 deletions
19
src/app/stats/db.tsx
Normal file
19
src/app/stats/db.tsx
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue