pineappaul
pineappaul
Explore posts from servers
DTDrizzle Team
Created by pineappaul on 4/23/2024 in #help
Drizzle pg client throwing `scanner_yyerror` on push
Getting the following error upon running drizzle-kit push:pg to my local postgres. Drizzle-Kit version 0.20.17 Drizzle-ORM version 0.30.9 using pg version 8.11.3 Error:
error: syntax error at or near ","
at /Users/paulmikulskis/Development/Archive/product-eng/node_modules/drizzle-kit/bin.cjs:43518:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PgPostgres.query (/Users/paulmikulskis/Development/Archive/product-eng/node_modules/drizzle-kit/bin.cjs:62584:21)
at async Command.<anonymous> (/Users/paulmikulskis/Development/Archive/product-eng/node_modules/drizzle-kit/bin.cjs:66268:9) {
length: 91,
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '152',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1241',
routine: 'scanner_yyerror'
}
error: syntax error at or near ","
at /Users/paulmikulskis/Development/Archive/product-eng/node_modules/drizzle-kit/bin.cjs:43518:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PgPostgres.query (/Users/paulmikulskis/Development/Archive/product-eng/node_modules/drizzle-kit/bin.cjs:62584:21)
at async Command.<anonymous> (/Users/paulmikulskis/Development/Archive/product-eng/node_modules/drizzle-kit/bin.cjs:66268:9) {
length: 91,
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '152',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1241',
routine: 'scanner_yyerror'
}
(Also made sure there are no dashes (- )in any fields nor table names.) Looking at bin.js where the error is throwing, I can see t error is thrown when Drizzle-Kit attempts to issue a statement to the given connection's client.
I console.log this statement to view this statement right before the error is thrown:
issuing statement: CREATE TABLE IF NOT EXISTS "grant_meta" (
"id" uuid PRIMARY KEY NOT NULL,
"grant_type" varchar(256) NOT NULL,
"categories" grant_category[] DEFAULT ,
"subject_type" "media_grant_subject_type" DEFAULT 'TRACK' NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
issuing statement: CREATE TABLE IF NOT EXISTS "grant_meta" (
"id" uuid PRIMARY KEY NOT NULL,
"grant_type" varchar(256) NOT NULL,
"categories" grant_category[] DEFAULT ,
"subject_type" "media_grant_subject_type" DEFAULT 'TRACK' NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
...nothing unusual jumps out to me. Some CREATE statements do work! What is most strange is that when this runs, drizzle will recognize the metadata from the journal and ask about each of the tables that should be created or replaced. After running through the whole, set I can notice two of the many tables get created on Drizzle-Studio, while the rest remain uncreated and the console throws the error user g0053 shared. You can see my package for drizzle db stuff and schema here: https://github.com/paulmikulskis/product-eng/tree/main/packages/db Thank you very much for any help!
2 replies
TTCTheo's Typesafe Cult
Created by pineappaul on 11/14/2023 in #questions
TRPC NextJS Context - Middleware Reload?
Howdy! We know the beloved T3 stack with app directory is now a streamlined thing, but there's a peculiarity with Clerk and TRPC. After signing in with Clerk, authenticated requests can only be made to the TRPC server after the user refreshes the page. Once the page is refreshed, authenticated requests to protected procedures work just fine. Reckon this is due to the root layout not re-running on the server, but could be totally off base there. Happy to open a thread and provide the actual implementation of the middleware as grabbed directly from the Next13 starter!
Thank you kindly.
13 replies