hk
hk
Explore posts from servers
DTDrizzle Team
Created by hk on 5/15/2024 in #help
Cannot read properties of undefined (reading 'compositePrimaryKeys')
My table
export const tableName = pgTable(
'table_name',
{
t1Id: varchar('t1_id', { length: 255 })
.notNull()
.references(() => t1.id),
t2Id: varchar('t2_id', { length: 255 })
.notNull()
.references(() => t2.id),
...defaults,
},
(table) => {
return {
pk: primaryKey({
columns: [table.t1Id, table.t2Id],
}),
};
},
);
export const tableName = pgTable(
'table_name',
{
t1Id: varchar('t1_id', { length: 255 })
.notNull()
.references(() => t1.id),
t2Id: varchar('t2_id', { length: 255 })
.notNull()
.references(() => t2.id),
...defaults,
},
(table) => {
return {
pk: primaryKey({
columns: [table.t1Id, table.t2Id],
}),
};
},
);
7 replies
DTDrizzle Team
Created by hk on 4/19/2024 in #help
long nested relation is exceeding 63 characters for Postgres
I have many relations that are named long and it's causing Postgres to truncate these long names when they are combined when querying too many nested relations
export const table1ToTable2Relations = relations(
table1ToTable2Relations,
({ one }) => ({
table1ToTable2: one(table2, {
fields: [table1ToTable2Relations.id],
references: [table2.id],
}),
}),
);
export const table1ToTable2Relations = relations(
table1ToTable2Relations,
({ one }) => ({
table1ToTable2: one(table2, {
fields: [table1ToTable2Relations.id],
references: [table2.id],
}),
}),
);
the amount of table1ToTable2 in the project is making an end query that contains many of the following as example: table1ToTable2_toTable3_table4_table6_table6ToTable7_table7 something like that which is surpassing the length allowed by Postgres I tried setting up the relationName to something short but it doesn't affect the end result query (still use the longer name) Any solution for this please? thanks!
2 replies
DTDrizzle Team
Created by hk on 1/11/2024 in #help
increase or decrease values
using the the db update, is there anyway to increase or decrease a number value without having to get it first from the database?
7 replies