Reputation: 11
So I have a Create React App (deprecated I know) and a Turso database that I am trying to connect to. My app needs to be able to read and write and I have a function to write that looks like this:
"use server"
import { db } from "./db";
import { tips } from './db/schema/tips';
export async function createTip(textContent, tag) {
const tipDetails = {
id: crypto.randomUUID(),
textContent,
tag,
};
await db.insert(tips).values(tipDetails);
}
But I'm running into an error that says this:
TypeError: Cannot read properties of undefined (reading 'Symbol(drizzle:Columns)')
at insert.ts:57:1
at Array.map (<anonymous>)
at SQLiteInsertBuilder.values (insert.ts:55:1)
at createTip (actions.jsx:13:1)
at handleSubmit (Home.jsx:95:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
at executeDispatch (react-dom.development.js:9041:1)
I am very new to anything that deals with backend so please explain like I am 5. All I need is is to be able to connect to this Turso database and be able to write. The database does not have any tables in it right now so if anyone can direct me on how I can initialize one that would be great. Thanks in advance.
Upvotes: 1
Views: 182