iLikeBikes
iLikeBikes
Explore posts from servers
DTDrizzle Team
Created by iLikeBikes on 12/15/2023 in #help
managing with geom types in postgis
I’m still using prisma for migrations 🤷‍♂️
7 replies
DTDrizzle Team
Created by iLikeBikes on 12/15/2023 in #help
managing with geom types in postgis
yeah the issue with it atm is that I am having issues using migrations with drizzle. If you do introspection with postgis setup it can do some weird things where it finds geography_columns, geometry_columns, and spatial_ref_sys
7 replies
DTDrizzle Team
Created by iLikeBikes on 9/6/2023 in #help
Drizzle cannot run directly in loader/action
I figured out that tables cannot be used directly. I had to pull in the database module from another turborepo package. And I needed to pull the table definitions through a ‘.server.ts’ file before using in a routes loader
3 replies
DTDrizzle Team
Created by iLikeBikes on 9/6/2023 in #help
Drizzle cannot run directly in loader/action
A little bit more context is that I am using drizzle and remix in a turbo repo. I have attempted to load drizzle in a server file by doing the following
// database package
import { drizzle as _drizzle } from "drizzle-orm/node-postgres";
import * as _drizzleValues from "../drizzle/schema";
import type * as _drizzleTypes from "../drizzle/schema";
import { Pool } from "pg";

if (!process.env.DATABASE_URL) throw Error("No database url found");
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
export const drizzle = _drizzle(pool);

globalForPrisma.prisma = prisma;

const { tables, ...drizzleValues } = _drizzleValues;
export { _drizzleTypes as drizzleTypes };
export { tables, drizzleValues };
// database package
import { drizzle as _drizzle } from "drizzle-orm/node-postgres";
import * as _drizzleValues from "../drizzle/schema";
import type * as _drizzleTypes from "../drizzle/schema";
import { Pool } from "pg";

if (!process.env.DATABASE_URL) throw Error("No database url found");
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
export const drizzle = _drizzle(pool);

globalForPrisma.prisma = prisma;

const { tables, ...drizzleValues } = _drizzleValues;
export { _drizzleTypes as drizzleTypes };
export { tables, drizzleValues };
// db.server.ts
import {drizzle} from 'database/index';
export const db = drizzle;
// db.server.ts
import {drizzle} from 'database/index';
export const db = drizzle;
3 replies