© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•6mo ago
AB

mysql bigint columns relational query loses precision

The products ids are correct but prices ids are wrong.

Already have

supportBigNumbers: true,
bigNumberStrings: true,

const products = await db.query.product.findMany({
    where: eq(product.active, true),
    with: {
      prices: {
        where: eq(price.productPriceType, productType),
      },
    },
const products = await db.query.product.findMany({
    where: eq(product.active, true),
    with: {
      prices: {
        where: eq(price.productPriceType, productType),
      },
    },


export const bigintString = customType<{
  data: string;
  driverData: string;
  notNull: false;
  default: false;
}>({
  dataType() {
    return "bigint unsigned";
  },

  fromDriver(value): string {
    console.log("fromDriver input:", value, typeof value);
    return value.toString();
  },
});
export const bigintString = customType<{
  data: string;
  driverData: string;
  notNull: false;
  default: false;
}>({
  dataType() {
    return "bigint unsigned";
  },

  fromDriver(value): string {
    console.log("fromDriver input:", value, typeof value);
    return value.toString();
  },
});
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Relational query builder in mysql?
Drizzle TeamDTDrizzle Team / help
3y ago
MySQL Relational CRUD
Drizzle TeamDTDrizzle Team / help
3y ago
Nullable relational query?
Drizzle TeamDTDrizzle Team / help
3y ago
Relational query problem
Drizzle TeamDTDrizzle Team / help
3y ago