db create

This commit is contained in:
Elijah McMorris 2024-02-15 15:11:46 -08:00
parent 19ae57d449
commit 809fe18090
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
9 changed files with 93 additions and 35 deletions

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

@ -0,0 +1,19 @@
"use server";
import { z } from "zod";
import { formSchema } from "./page";
export async function querydb(values: z.infer<typeof formSchema>) {
// let db = await initConnection();
// let url = await db.query(`
// create url:[rand::string(8)] CONTENT {
// long_url: string::replace($long_url, "http://", "https://"),
// clicks: 0,
// date_added: time::now(),
// date_accessed: <future> { time::now() }
// } return id[0];
// `, { long_url: values.url });
let url = "test";
console.log(values.url, url)
return url;
}