Arctic
Arctic
TTCTheo's Typesafe Cult
Created by Quatre on 11/7/2023 in #questions
db:push Error out
👍
10 replies
TTCTheo's Typesafe Cult
Created by Quatre on 11/7/2023 in #questions
db:push Error out
Its just a different format for the query parameters
10 replies
TTCTheo's Typesafe Cult
Created by Quatre on 11/7/2023 in #questions
db:push Error out
Thats what the ?ssl={rejectUnauthorized... replaces
10 replies
TTCTheo's Typesafe Cult
Created by Quatre on 11/7/2023 in #questions
db:push Error out
# Drizzle
# Get the Database URL from the "prisma" dropdown selector in PlanetScale.
# Change the query params at the end of the URL to "?ssl={"rejectUnauthorized":true}"
# Drizzle
# Get the Database URL from the "prisma" dropdown selector in PlanetScale.
# Change the query params at the end of the URL to "?ssl={"rejectUnauthorized":true}"
If using planetsclale did you follow these instructions from the .env file
10 replies
TTCTheo's Typesafe Cult
Created by Arctic on 10/28/2023 in #questions
Weird behavior in TS api endpoint
POST = async(request) => {
fetch initial data...
const players: Map<string, Player> = new Map();
const teams: Map<string, Team> = new Map();
for await (const match of initialdata){
validatematch()
if(matchisvalid){
match.stats.forEach((stat) => {
stat.stats.teams.forEach((team) => {
teams.set(team.TeamId, team);
team.players.forEach((player) => {
players.set(player.puuid, player);
});
});
});
}
}
return Response.json({ teams: [...teams.values()], players: [...players.values()] });
})
POST = async(request) => {
fetch initial data...
const players: Map<string, Player> = new Map();
const teams: Map<string, Team> = new Map();
for await (const match of initialdata){
validatematch()
if(matchisvalid){
match.stats.forEach((stat) => {
stat.stats.teams.forEach((team) => {
teams.set(team.TeamId, team);
team.players.forEach((player) => {
players.set(player.puuid, player);
});
});
});
}
}
return Response.json({ teams: [...teams.values()], players: [...players.values()] });
})
9 replies
TTCTheo's Typesafe Cult
Created by Arctic on 10/28/2023 in #questions
Weird behavior in TS api endpoint
Ended up finding the solution, changed to a for await loop
9 replies
TTCTheo's Typesafe Cult
Created by Arctic on 10/28/2023 in #questions
Weird behavior in TS api endpoint
I know its something with the async context but cant figure out how to get it to behave as intended
9 replies
TTCTheo's Typesafe Cult
Created by Arctic on 10/28/2023 in #questions
Weird behavior in TS api endpoint
But on the response im only getting teams: Array(0) and same for players
9 replies
TTCTheo's Typesafe Cult
Created by Arctic on 10/28/2023 in #questions
Weird behavior in TS api endpoint
POST = async(request) => {
fetch initial data...
const players: Map<string, Player> = new Map();
const teams: Map<string, Team> = new Map();
await(async() => {
initialData.forEach((match) => {
validatematch()
if(matchisvalid){
match.stats.forEach((stat) => {
stat.stats.teams.forEach((team) => {
teams.set(team.TeamId, team);
team.players.forEach((player) => {
players.set(player.puuid, player);
});
});
});
}
})
})
return Response.json({ teams: [...teams.values()], players: [...players.values()] });
})
POST = async(request) => {
fetch initial data...
const players: Map<string, Player> = new Map();
const teams: Map<string, Team> = new Map();
await(async() => {
initialData.forEach((match) => {
validatematch()
if(matchisvalid){
match.stats.forEach((stat) => {
stat.stats.teams.forEach((team) => {
teams.set(team.TeamId, team);
team.players.forEach((player) => {
players.set(player.puuid, player);
});
});
});
}
})
})
return Response.json({ teams: [...teams.values()], players: [...players.values()] });
})
9 replies
TTCTheo's Typesafe Cult
Created by Arctic on 10/28/2023 in #questions
Weird behavior in TS api endpoint
Current function structure is as follows:
9 replies
TTCTheo's Typesafe Cult
Created by Efkan on 10/13/2023 in #questions
Drizzle Schema Boolean
Generated columns are just made from combining data already in the table, https://stackoverflow.com/questions/10273750/sql-conditional-not-null-constraint should answer your question as far as i can tell
8 replies
TTCTheo's Typesafe Cult
Created by om3r on 10/9/2023 in #questions
Uploading Files in T3-Stack
Not sure if it will help or not but that was a similar ish question
8 replies
TTCTheo's Typesafe Cult
Created by om3r on 10/9/2023 in #questions
Uploading Files in T3-Stack
I would recommend a file storage solution like uploadthing or AWS S3 which is what upload thing uses behind the scenes. Relational databases are not really meant to store file information
8 replies