kaleembhatti
kaleembhatti
TTCTheo's Typesafe Cult
Created by noynek2242 on 2/21/2024 in #questions
Client/Server Mutations
But your method works (if it works, it works, dont change it) this is just how i might complete the task
7 replies
TTCTheo's Typesafe Cult
Created by noynek2242 on 2/21/2024 in #questions
Client/Server Mutations
"The issue being if there are any differences between what was saved vs the state of the form" I would return the new state and save it inside the initialState (which is passed onto the server action). And based on that the form could update reflecting changes like success or fail, etc
7 replies
TTCTheo's Typesafe Cult
Created by noynek2242 on 2/21/2024 in #questions
Client/Server Mutations
You can look into server actions
7 replies
TTCTheo's Typesafe Cult
Created by mattz on 1/7/2024 in #questions
ssg with app router
ohhh
38 replies
TTCTheo's Typesafe Cult
Created by mattz on 1/7/2024 in #questions
ssg with app router
.
38 replies
TTCTheo's Typesafe Cult
Created by mattz on 1/7/2024 in #questions
ssg with app router
try what the person did in this ss i have no idea how but this also seemed to work
38 replies
TTCTheo's Typesafe Cult
Created by mattz on 1/7/2024 in #questions
ssg with app router
Although looking at my current repo its working normally without this statement
38 replies
TTCTheo's Typesafe Cult
Created by mattz on 1/7/2024 in #questions
ssg with app router
export const dynamic = "force-dynamic"
export const dynamic = "force-dynamic"
Writing this in the file did fixed the error Nothing official i guess
38 replies
TTCTheo's Typesafe Cult
Created by kaleembhatti on 2/17/2024 in #questions
Drizzle + Turso Migration Problem
For some reason everything is working now
Super strange
For some reason everything is working now
Super strange
3 replies
TTCTheo's Typesafe Cult
Created by kaleembhatti on 2/17/2024 in #questions
Drizzle + Turso Migration Problem
Database Migrate ("src/server/db/migrate.ts")
import { drizzle } from "drizzle-orm/better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import Database from "better-sqlite3";

const betterSqlite = new Database(":memory:");
const db = drizzle(betterSqlite);
migrate(db, { migrationsFolder: "drizzle" });
betterSqlite.close();
import { drizzle } from "drizzle-orm/better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import Database from "better-sqlite3";

const betterSqlite = new Database(":memory:");
const db = drizzle(betterSqlite);
migrate(db, { migrationsFolder: "drizzle" });
betterSqlite.close();
Latest Migration File Generated ("drizzle")
ALTER TABLE subjects ADD `visibility` text DEFAULT 'Pending' NOT NULL;--> statement-breakpoint
ALTER TABLE subjects ADD `education_level` text NOT NULL;--> statement-breakpoint
CREATE INDEX `title_idx` ON `subjects` (`title`);
ALTER TABLE subjects ADD `visibility` text DEFAULT 'Pending' NOT NULL;--> statement-breakpoint
ALTER TABLE subjects ADD `education_level` text NOT NULL;--> statement-breakpoint
CREATE INDEX `title_idx` ON `subjects` (`title`);
What I See in the console
CREATE TABLE `subjects` (
`id` integer PRIMARY KEY NOT NULL,
`title` text NOT NULL,
`overview` text NOT NULL,
`visibility` text DEFAULT 'Pending' NOT NULL,
`education_level` text NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL
);

CREATE INDEX `title_idx` ON `subjects` (`title`);
CREATE TABLE `subjects` (
`id` integer PRIMARY KEY NOT NULL,
`title` text NOT NULL,
`overview` text NOT NULL,
`visibility` text DEFAULT 'Pending' NOT NULL,
`education_level` text NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL
);

CREATE INDEX `title_idx` ON `subjects` (`title`);
Order of commands:
npm run db:generate
npm run db:push
npm run db:generate
npm run db:push
I have no idea why its creating the table again, all the fields and schema is up to date but it just tries to create a new table which can only happen if the table is dropped. Can anyone tell me what i am doing wrong as this will remove all of the data previously stored. I read the docs multiple times and most of the code here is straight taken from the docs. I am using the t3 stack (Nextjs App Router, Trpc, Drizzle, Turso, Etc) Thanks 🙂 Ps: I am new to Turso
3 replies
TTCTheo's Typesafe Cult
Created by mosesintech on 2/13/2024 in #questions
html-react-parser and "Unsafe call of an `any` typed value".
Could be Try refreshing the typescript server
5 replies
TTCTheo's Typesafe Cult
Created by mosesintech on 2/13/2024 in #questions
html-react-parser and "Unsafe call of an `any` typed value".
I am not that good with typescript but this is the github page https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-call.md maybe set a type to the parser function or to it's returned value or just double check your WpMenuItem type.
5 replies
TTCTheo's Typesafe Cult
Created by beebae on 2/12/2024 in #questions
how to add video in next js for hero componentt
Try adding a fallback to check if your browser supports the video playback. Could be that the path to the video is wrong
5 replies
TTCTheo's Typesafe Cult
Created by kaleembhatti on 2/11/2024 in #questions
Planetscale pricing changes (hobby plan not available)
thank you everyone for the replies ill look into all of the options you all mentioned thanks
12 replies
TTCTheo's Typesafe Cult
Created by KO on 1/13/2024 in #questions
Theo uses api.posts.getAll.useQuery() in T3 tutorial video, but T3 app only has .query() calls.
damnn
18 replies
TTCTheo's Typesafe Cult
Created by KO on 1/13/2024 in #questions
Theo uses api.posts.getAll.useQuery() in T3 tutorial video, but T3 app only has .query() calls.
ohhhhh
18 replies
TTCTheo's Typesafe Cult
Created by LUNA on 1/10/2024 in #questions
Type error with Clerk, Just trying to use useUser()
thats why i forwarded the docs
9 replies
TTCTheo's Typesafe Cult
Created by LUNA on 1/10/2024 in #questions
Type error with Clerk, Just trying to use useUser()
the function you are trying to use isnt available inside next js it is available inside normal react if you are using next js consider looking at the docs for the right function https://clerk.com/docs/references/nextjs/overview
9 replies
TTCTheo's Typesafe Cult
Created by KO on 1/13/2024 in #questions
Theo uses api.posts.getAll.useQuery() in T3 tutorial video, but T3 app only has .query() calls.
well things are different in the app router dont worry just the naming convention has changed, functionality remains the same
18 replies