Skip to content

[BUG]: timestamp with mode string is returned as Date object instead of string -- when using Bun SQL (drizzle-orm/bun-sql) #4493

@arvilmena

Description

@arvilmena

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.43.1

What version of drizzle-kit are you using?

0.31.0

Other packages

No response

Describe the Bug

This is exactly like: #806

even if you defined timestamp mode to "string", drizzle will still convert it to "date" object

This occurs if you are importing drizzle from"drizzle-orm/bun-sql"

Will not work:

import { SQL } from "bun";
import { drizzle } from "drizzle-orm/bun-sql";
import { DB_CONFIG } from "./db.config";
import * as schema from "./schema";

const client = new SQL(DB_CONFIG.DATABASE_URL);
export const db = drizzle({ client, schema });

Will get fixed if you switch to "drizzle-orm/node-postgres"/"pg"

import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
import { DB_CONFIG } from "./db.config";
import * as schema from "./schema";

const client = new Pool({
  connectionString: DB_CONFIG.DATABASE_URL,
});
export const db = drizzle({ client, schema });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions