Mozzy
Mozzy
Explore posts from servers
DTDrizzle Team
Created by Mozzy on 10/8/2024 in #help
Changing the Postgres serial/autoincrement behavior
In short, I don't want the serial to fill the empty gaps. I want it to always default to max(id) + 1 unless I specify the id myself. How can I achieve this with minimum jank? I've heard of generated columns, but couldn't get it all working together. I believe MySQL works like this, so I might have to switch to that.
2 replies
DTDrizzle Team
Created by Mozzy on 10/3/2024 in #help
`Error: no such column: unboxes.rarity` with `findMany()`
Hello. I am getting the error Error: no such column: unboxes.rarity despite not using unboxes.rarity The error comes fron the where in the query below. Is this a bug? Code:
export const getFilteredUnboxes = async (onlyCoverts?: boolean) =>
db.query.unboxes.findMany({
with: {
item: true,
case: true,
},
where: onlyCoverts
? inArray(items.rarity, ["Covert", "Extraordinary"])
: undefined,
});
export const getFilteredUnboxes = async (onlyCoverts?: boolean) =>
db.query.unboxes.findMany({
with: {
item: true,
case: true,
},
where: onlyCoverts
? inArray(items.rarity, ["Covert", "Extraordinary"])
: undefined,
});
My items schema:
export const items = sqliteTable(
"items",
{
id: text("id").primaryKey().notNull(),
name: text("name").notNull(),
description: text("description"),
image: text("image").notNull(),
rarity: text("rarity").notNull(),
phase: text("phase"),
},
table => {
return {
idxRarity: index("idx_rarity").on(table.rarity),
};
},
);
export const items = sqliteTable(
"items",
{
id: text("id").primaryKey().notNull(),
name: text("name").notNull(),
description: text("description"),
image: text("image").notNull(),
rarity: text("rarity").notNull(),
phase: text("phase"),
},
table => {
return {
idxRarity: index("idx_rarity").on(table.rarity),
};
},
);
32 replies
DIdiscord.js - Imagine ❄
Created by Mozzy on 2/10/2024 in #djs-questions
Issues with discord.js errors in Bun
No description
23 replies
CDCloudflare Developers
Created by Mozzy on 4/25/2023 in #workers-help
What is the difference between `CF-Connecting-IP` and `X-Real-IP` and can they ever be empty?
Using it for a simple rate-limiting purpose and was wondering :)
8 replies
DIdiscord.js - Imagine ❄
Created by Mozzy on 7/29/2022 in #djs-questions
(known issue on v14.1.0) messageLink is not a function
Trying the "new" Message.url leads to getting this error.
TypeError: messageLink is not a function
at Message.get url [as url] (...\node_modules\discord.js\src\structures\Message.js:443:29)
TypeError: messageLink is not a function
at Message.get url [as url] (...\node_modules\discord.js\src\structures\Message.js:443:29)
It's thrown from https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/Message.js#L443. Does this just mean that @discordjs/builders hasn't been updated yet? discord.js v14.1.0 Node v16.13.1
9 replies
DIdiscord.js - Imagine ❄
Created by Mozzy on 7/18/2022 in #djs-questions
Change in ActionRow stuff
Feeling a bit stupid, what change in v14 is related to this being needed? row is an ActionRowBuilder, not a received row.
- const content = { components: [row.setComponents(row.components.filter(x => !x.customId))] };
+ const content = { components: [row.setComponents(row.components.filter(x => !x.data.custom_id))] };
- const content = { components: [row.setComponents(row.components.filter(x => !x.customId))] };
+ const content = { components: [row.setComponents(row.components.filter(x => !x.data.custom_id))] };
42 replies