regex
regex
Explore posts from servers
DTDrizzle Team
Created by regex on 9/27/2024 in #help
Type error in 0.33.0
export const cities = pgTable("cities", {
id: serial("id").primaryKey(),
name: varchar("name", { length: 256 }),
});
export const cities = pgTable("cities", {
id: serial("id").primaryKey(),
name: varchar("name", { length: 256 }),
});
Argument type {name: PgVarcharBuilder<{name: "name", dataType: "string", columnType: "PgVarchar", data: [string, ...string[]][number], driverParam: string, enumValues: [string, ...string[]], generated: undefined}>, id: PgSerialBuilder & {: {notNull: true}} & {: {isPrimaryKey: true}}} is not assignable to parameter type Record<string, PgColumnBuilderBase> Setting the id with .primaryKey throws a type error.
1 replies
TTCTheo's Typesafe Cult
Created by regex on 8/3/2024 in #questions
Uploadthing, image is accessible even after deletion?
Hey, I am removing a file from uploadthing, i can see that the file is removed from the bucket but whenever I try to access it using the url, i can still access it. Is there some other thing that i need to do?
10 replies
DTDrizzle Team
Created by regex on 6/22/2024 in #help
Is this a bad pattern to do? I wanna call my local postgre while developing and use neon in prod.
import { drizzle as drizzleNeon } from "drizzle-orm/neon-http";
import { drizzle as drizzlePostgres } from "drizzle-orm/postgres-js";

import { neon } from "@neondatabase/serverless";
import { config } from "dotenv";
import postgres from "postgres";
import { isProd } from "@/lib/utils";
config({ path: ".env" });

// Dev
const queryClient = postgres(process.env.DEV_DATABASE_URL!);
// Prod
const sql = neon(process.env.PROD_DATABASE_URL!);

export const db = isProd() ? drizzleNeon(sql) : drizzlePostgres(queryClient);
import { drizzle as drizzleNeon } from "drizzle-orm/neon-http";
import { drizzle as drizzlePostgres } from "drizzle-orm/postgres-js";

import { neon } from "@neondatabase/serverless";
import { config } from "dotenv";
import postgres from "postgres";
import { isProd } from "@/lib/utils";
config({ path: ".env" });

// Dev
const queryClient = postgres(process.env.DEV_DATABASE_URL!);
// Prod
const sql = neon(process.env.PROD_DATABASE_URL!);

export const db = isProd() ? drizzleNeon(sql) : drizzlePostgres(queryClient);
Has anyone tried something like this?
5 replies