HAL 9000
HAL 9000
Explore posts from servers
DTDrizzle Team
Created by HAL 9000 on 1/22/2024 in #help
Magic sql`` operator array
Thanks a lot, I'll try it. One more thing, which is completely unrelated to this: I haven't been able to find information on how to make a unique constraint deferrable in the documentation.
16 replies
DTDrizzle Team
Created by Adamgreg on 9/2/2023 in #help
Deferrable foreign key constraints
Is there any update on this? Any way toset deferrable on a unique constraint?
3 replies
DTDrizzle Team
Created by HAL 9000 on 1/22/2024 in #help
Magic sql`` operator array
first of all, thanks for the reply, I have a JSONB column with the following structure: { "value": "Completed" } and I get array of values from url search params and pass it to a function where I do the database query using drizzle orm ["Completed", "In Progress", "Cancelled"]. I want to check the value field of JSONB column exists in this array of values for filtering purposes.
16 replies
DTDrizzle Team
Created by HAL 9000 on 1/22/2024 in #help
Magic sql`` operator array
@Angelelz I can’t use inArray because the column value is JSONB. I don’t know how to exactly use with JSONB columns
16 replies
DTDrizzle Team
Created by HAL 9000 on 1/22/2024 in #help
Magic sql`` operator array
The column I am trying to to check is JSONB tough
16 replies
DTDrizzle Team
Created by HAL 9000 on 1/22/2024 in #help
Magic sql`` operator array
I am going to check if a column value is in this array. I just want to pass it safely because the array comes from url search params
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
so the flow is generate migrations and then run migrations?
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
ok got it.
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
I thought drizzle kit push would handle that
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
I think that was the reason I skipped migrate.ts part
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
I actualy need migrate.ts file. However, I don't think neon-db has migrator?
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
here is my db.ts
import { neon, neonConfig } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';

neonConfig.fetchConnectionCache = true;

const sql = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);


export { db };
import { neon, neonConfig } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';

neonConfig.fetchConnectionCache = true;

const sql = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);


export { db };
and config:
import type { Config } from "drizzle-kit";
export default {
schema: "./lib/schema.ts",
out: "./drizzle",
driver: 'pg',
verbose: true,
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
strict: true,
} satisfies Config;
import type { Config } from "drizzle-kit";
export default {
schema: "./lib/schema.ts",
out: "./drizzle",
driver: 'pg',
verbose: true,
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
strict: true,
} satisfies Config;
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
I thought running push was applying all the migrations.
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
I was acutally trying to push.
16 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
@solo I sent my schema and unpushed migrations to this thread: https://discord.com/channels/1043890932593987624/1127209652694810816/1187820903963312229
16 replies