mysql bigint columns relational query loses precision
The products ids are correct but prices ids are wrong.
Already have
supportBigNumbers: true,
bigNumberStrings: true,
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),
},
},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();
},
});