Liam
Explore posts from serversDTDrizzle Team
•Created by Liam on 7/31/2024 in #help
There is not enough information to infer relation
Hello,
I am running into a issue where drizzle studio is stating that there is not enought information to infer relation
"__public__.tickets.chat"
. Any idea why this might be?
I have the following schema:
5 replies
DTDrizzle Team
•Created by Liam on 7/28/2024 in #help
Drizzle Query Returns Different Result Than Select
Made a issue over on github for this, and wanted to see if anyone has ran into anything similar. Thanks!
https://github.com/drizzle-team/drizzle-orm/issues/2703
1 replies
DTDrizzle Team
•Created by Liam on 5/22/2024 in #help
Drizzle-Zod Set Default Minimum Length For Text / No Empty Strings
Hello!
I am using drizzle zod to validate some input, at the moment the schema for any
text
columns allows empty strings. I would like to require that all strings cannnot be empty. Is there any way to do this without having to manually define each column as z.string().min(1)
?
Thanks!1 replies
DTDrizzle Team
•Created by Liam on 5/4/2024 in #help
Issue With Defining References
Hello!
I am attempting to define a reference to another table. I have the following users table:
however when update the tables to have the references like so
it gives me a type error on both tables:
Any idea why this might be? Thanks for the help!
1 replies
DTDrizzle Team
•Created by Liam on 3/6/2024 in #help
Using Drizzle w/ Postgrest
Hi!
I was wondering if there is a way to use drizzle w/ postgrest so I can use drizzle on edge. I could not find anything about this in the docs so I thought I'd ask here.
Thanks!
1 replies
DTDrizzle Team
•Created by Liam on 2/5/2024 in #help
Invalid Input Value for Enum
Hello! I am using a enum but running into a weird issue when trying to set the value as one of options in enum. The following is the sections from my schema:
Error:
Error: invalid input value for enum status: "expired"
Drizzle Schema Table:
Drizzle Schema Enum:
Any idea why this might be? Thanks!5 replies
DTDrizzle Team
•Created by Liam on 12/27/2023 in #help
Drizzle query with where clause and primary composite key
Hello, I have defined a composite key and am now trying to run a drizzle query to lookup the event where that key exists. I have defined the following query, is this the fastest way to go about doing this lookup? Thanks!
Drizzle Schema Table:
Lookup:
Thanks for the help!
2 replies
DTDrizzle Team
•Created by Liam on 7/29/2023 in #help
Cannot Access Primary Key on Table
Hello, I am trying to access the primary key named
id
on the following table:
I am using the following command to try to update a row but I am getting an error and the id
field does not show on the invite. Any idea why this might be? Thanks!
4 replies
DTDrizzle Team
•Created by Liam on 7/19/2023 in #help
Error When Applying Migrations Related to Text Indexes
Hello, I am attempting to apply some new migrations, however I am getting the following error when attempting to do so. Any idea why this is? Thanks!
Error:
DatabaseError: target: hackkit.-.primary: vttablet: BLOB/TEXT column 'presigned_url' used in key specification without a key length (errno 1170) (sqlstate 42000) (CallerID: v6f912c7oc1zkrupmyrv): Sql: "create table files (\n\tpresigned_url text not null,\n\t
key varchar(500) not null,\n\tvalidated boolean not null default false,\n\ttype enum('generic', 'resume') not null,\n\towner_id varchar(255) not null,\n\tconstraint files_presigned_url_unique UNIQUE key (presigned_url),\n\tconstraint files_key_unique UNIQUE key (
key)\n)", BindVars: {REDACTED}
Section of schema.ts
1 replies
DTDrizzle Team
•Created by Liam on 7/18/2023 in #help
Importing drizzle-zod Schemas on the Client
Hi,
Is it ok to import schemas generated with
drizzle-zod
via createInsertSchema
on the client? I have my schema in a separate schema.ts
file away from where I init my database if that matters at all.
Thanks!16 replies
DTDrizzle Team
•Created by Liam on 7/8/2023 in #help
Drizzle-zod Include Relations
Hello,
I was wondering if
drizzle-zod
includes support for relations, and if so how I can include them. Thanks!10 replies
DTDrizzle Team
•Created by Liam on 7/5/2023 in #help
Drizzle Count # of Records
What would be the best way to count records in drizzle? Thanks!
7 replies
DTDrizzle Team
•Created by Liam on 7/4/2023 in #help
Inserting with Relation
Hi,
What is the way of inserting a new record with a relationship in Drizzle. I understand that Prisma abstracts this away as if you are inserting everything as once but under the hood it breaks it up into multiple queries. Is there anything like this in drizzle?
4 replies
DTDrizzle Team
•Created by Liam on 7/2/2023 in #help
How to apply migrations on postgres in a serverless enviroment?
Hello,
I want to apply postgres migrations to my vercel DB. I see that the push command does not work for postgres and am therefore attempting to use the migrate function like so:
However this does not seem like the best way to do this as that would make it so migrations are applied only one I am attempting to make a call instead of at something like build time as far as I can tell. Additionally, it is additional imports that will have to be loaded in the serverless and/or edge environment. Is there a better way to do this?
6 replies
DTDrizzle Team
•Created by Liam on 6/16/2023 in #help
Using PgArray
Hello,
How can I use postgres arrays in drizzle? I want to have one column to be a string array. Thanks!
2 replies
DTDrizzle Team
•Created by Liam on 6/13/2023 in #help
What does this section of the docs mean?
Under the docs for indexes and constraints it says that drizzle kit only supports index
name
and on()
param. What does this mean? Would the following not work with drizzle kit then?
3 replies
DTDrizzle Team
•Created by Liam on 6/12/2023 in #help
Getting Started With Drizzle And Had A Few Questions
Hi! I'm getting started with drizzle after having been a long time Prisma user. I had a few questions about Drizzle as I'm getting started:
1. Is there a "cuid()" type of functionality where instead of using a integer key I can use a CUID?
2. How can I set non-id fields to be unique (In prisma, this was doable with the
@unique
)?
Thanks in advance for the help!1 replies