NoelHuibers
NoelHuibers
TTCTheo's Typesafe Cult
Created by NoelHuibers on 2/1/2024 in #questions
Drizzle Planetscale "text" in schema (MySQL) "Key specification without key length"
For refrences what i found in the drizzle discord: Worked for me (Option 1) Same question was asked by Theo there. He used Option2. Option1: You can create an Index for text/blob, but you should specify a length for it. This length indicates which portion of the text field will be indexed. Limits for that are 767 or 3072 bytes(depending on the row format). Drizzle doesn't have this possibility, but it's a great case to have it(I just never indexed text fields, I was using second option I'm going to explain) Workaround to make it work with drizzle db push -> create this index manually. Be sure to name it same way you name it in drizzle. In this case drizzle-kit won't see a difference there and won't be triggered to change an index Option 2 Use varchar with specific length and create an index for it. This one should work well with Drizzle. Varchar will be fully indexed, when text will be only partially indexed on a size you choose. So all depends on your usecase
6 replies
TTCTheo's Typesafe Cult
Created by NoelHuibers on 2/1/2024 in #questions
Drizzle Planetscale "text" in schema (MySQL) "Key specification without key length"
Sorry forgot to change the errormessage to the corresponding table. Problem is with Drizzles kit. Is working when using SQL raw to create the table.
6 replies
TTCTheo's Typesafe Cult
Created by NoelHuibers on 1/21/2023 in #questions
Filedownload through tRPC
I made a CodeSandbox for this: https://codesandbox.io/p/github/NoelHuibers/test/example Notice that CodeSandbox does not let you download files in their sandbox. Files that are important: pages/index & server/router/download
3 replies