The Fabulous Geek
The Fabulous Geek
Explore posts from servers
DTDrizzle Team
Created by The Fabulous Geek on 10/9/2024 in #help
db client typing
Good morning. I am using the new connect method, and working on typing. I am new to TS so still working out how to make it work.
interface Client {
config: Config;
interactions: Collection<string, InteractionSpark | CommandSpark>;
gates: Collection<string, Gate>;
logger: Logger;
scheduledEvents: Collection<string, CronJob>;
db: any;
}

client.db = await drizzle('node-postgres', dbURL);
interface Client {
config: Config;
interactions: Collection<string, InteractionSpark | CommandSpark>;
gates: Collection<string, Gate>;
logger: Logger;
scheduledEvents: Collection<string, CronJob>;
db: any;
}

client.db = await drizzle('node-postgres', dbURL);
Clearly, I do not want any here; I just put it there for the moment as I figure out the correct type. I am just not sure what to do. Normally, I use the function returns for clues, but in this case, DetermineClient is not exported, and I doubt it is correct anyway.
1 replies
DTDrizzle Team
Created by The Fabulous Geek on 6/15/2024 in #help
Automating migration
I am considering adding code to run a migration within my server startup. Basically, any time the server starts, the migration will run. The idea is that when the code is updated and the server restarts, the database stays up to date. My questions: a) is there a way programmatically to determine if there is a need to do a migration? b) is there are a harm in running the migration every time you start up your server (migrate(database, { migrationsFolder: './db/drizzle' });)
2 replies