Richard E
Explore posts from serversIs it possible for any env variables to be leaked from the nitro server package?
After build I can see my db connection info from the env variable embedded into the node-server.mjs file. Is there any way at all that could be surfaced to the client if all my code that uses that variable is in a server route such as trpc calls?
1 replies
DTDrizzle Team
•Created by Richard E on 3/28/2024 in #help
How can I convert a null value to integer in a select?
I am doing a left join so joined table may contain null fields. In this case I have a player.ranking field that if null I want to default to 9999. I've tried numerous ways but nothing is working:
4 replies
DTDrizzle Team
•Created by Richard E on 3/7/2024 in #help
Is there a way to set foreign key on a bulk insert?
Apologies if this is a stupid question but I need to know if I'm missing something obvious. I have two tables where the second one has a foreign key relationship to the other, standard master/detail setup.
After I insert the master records, call the entity
Pool
I return the new id
and then I loop through an array of detail records and set that foreign key pool_id
to the newly acquired id
and then do a batch insert of those detail records PoolTeam
like so
Is there any way I can specify the master record id
in this insert statement without having to previous loop through the array setting the pool_id
property? It it possible to do this master/detail insert in a single call with Drizzle? It works the way I have it but just seems wrong to do it this way.2 replies
Getting 404 after app.config.ts change
Not sure if anyone else if getting this but I've been making changes to app.config.ts in dev mode and Nitro is triggering a page reload but I'm then getting a 404 of that page. If I wait a little while I can refresh the page and everything is fine.
Here is what I'm doing if you can reproduce.
1. Using the nuxt-ui-pro/saas project template here, https://github.com/nuxt-ui-pro/saas
2. Creating the initial site off the template with
npx nuxi init -t github:nuxt-ui-pro/saas
3. Opening the code up with VS Code, then starting the dev server with pnpm run dev
and everything looks fine
4. In the content subfolder, edit the 0.index.yml
file and change the hero title and you should see everything hot reloads. I have developer tools open for my browser with Disable cache
ticked because if I don't I get some cached content from another site I had on localhost:3000
5. Now if I edit the app.config.ts file and change anything or even just save what is already there Nitro sees a change and reloads that file, but in the brower I get the following:
6. If I refresh my browser page then I get the full page with changes
Any ideas? This is killing any productivity I might have in editing the site and really annoying.4 replies
DTDrizzle Team
•Created by Richard E on 1/10/2024 in #help
Is there a way to introspect with specific order?
When I generate my schema file with introspect:pg the tables are not in any order was far as I can see. They are probably in whatever order I created them but it's very messy with a lot of tables. Is there any way to put some kind of order to this?
3 replies
DTDrizzle Team
•Created by Richard E on 12/6/2023 in #help
Infer select that includes a foreign key object collection?
If I have a query such as the following:
how can I use something like to infer users with posts included?
2 replies