Nickolaki
Explore posts from serversDTDrizzle Team
•Created by Nickolaki on 8/16/2023 in #help
Db race condition
Is there any tool with drizzle that can help with handling race conditions?
38 replies
DTDrizzle Team
•Created by Nickolaki on 8/13/2023 in #help
Query where clause with array.
How can I get something like this to work?
I want the where clause to match any product that has a name thats inside the products array.
4 replies
DTDrizzle Team
•Created by Nickolaki on 8/11/2023 in #help
Insert One to Many
How can I insert relations as well at create the parent?
My schema:
I want to add products to the insert for creating the new journey. Currently using a transaction but not sure what the code needs to be for linking products to the journey?
52 replies
✅ Override JWT Bearer service for Tests
My app uses this setup for its authentication:
I then usually extract my userId's like this:
What would be a good way to override this authentication so that I don't have to use real Clerk https://clerk.com/ JWT's during testing.
I'm thinking that I simply override these params:
For "Test" JWT's and use a helper function to create these during my tests?
12 replies
❔ ConfigureTestServices not overriding connection string value :(
Hi!
I'm so lost as to why this isn't working.
Currently the RemoveDbContext removes the service as expected. And I get no exceptions from re-adding with the new config. I have debugged that if I change my development appsettings to the hardcoded connection string from the created container it works fine. But as soon as I change dev connection string back to what it is I get db login issues/couldn't establish connection issues. So it must not be overriding the config.
Any ideas on how I can fix this?
11 replies
❔ Unable to get sqlcmd working on Apple Silicon
I'm running a test Docker container on my M2 Mac and the test always get stuck on this command and just repeatedly tries to fire it. I've cloned my repo on my PC (Windows) and it runs fine and creates the DB tables as expected.
Does anyone have any advice on how I can fix this?
5 replies
❔ Change default behaviour of .NET Web API Validation Errors
Hi does anyone know how I can override the default problem details/validation error response .net gives when things like Guid and DateTime's are in an incorrect format?
I have implemented my own validation error responses but can't seem to avoid these type of ones firing^
Mine look like this:
FYI: my validation logic is driven by FluentValidation, I'm not using attributes etc.
4 replies
❔ Identity Framework Users with OAuth clients.
https://i.imgur.com/A5jjfhk.png
I'm following the following drawing in my NextJs frontend and .Net 6 Web API. My implementation is working as the diagram states, however, I've run into the following issue:
- The JWT that I sign and give back to my frontend has the Id and Username from the Github but I'm using Identity Framework to store my users. Technically my app doesn't need an identity user to be stored to run, my object UserId property would just have a Github, Google, Facebook user ids. But as you can tell this is far from ideal, what do you think would be a good solution here?
I had thought of maybe checking if a user with that email exists in the database first, if not create the user. But I believe Identity Framework would require the users password which I cannot provide.
Here is some code snippets to give further context:
Any help/advice would be much appreciated! 🤘
2 replies
❔ Querying Many to Many EF Relationships
What is the best way to query Many to Many relationships? I'm using Ardalis.Specification package and this is my current workaround to get a Job's list of Contacts. It feels like there is something simpler staring at me 🤣
Content: I'm using JobContact in either side of this relationship.
Content: I'm using JobContact in either side of this relationship.
3 replies