nightspite
nightspite
Explore posts from servers
TtRPC
Created by nightspite on 4/10/2024 in #❓-help
How do I exclude properties while returning data?
Sure in most of the cases, but in the edge case, where for example a value of one property is null I would rather have it returned with the null there than to have a validation error. Or in the case of using the same schema for validating input (for example setting min length of a string) and output, if a record with min length that would not satisfy this validation would also throw the error, even tho it might be unnecessary. Just my way of thinking about this problem. I had this problem with ts-rest, that is also using zod for validating output, that's why it's on my mind and I'm looking for other ways to solve it
6 replies
TtRPC
Created by nightspite on 4/10/2024 in #❓-help
How do I exclude properties while returning data?
how do you actually achieve that? you can technically parse them, so they will automatically strip all unnecessary properties, but if the parse would fail, then you are left with zod validation error and nothing got returned
6 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
No description
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
if the types are not equal it will yell, for these checks
const _insertApiKey: Equals<InternalInsertApiKeyType, InsertApiKeyType> = true;
const _insertApiKey: Equals<InternalInsertApiKeyType, InsertApiKeyType> = true;
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
No description
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
No description
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
No description
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
Update: I have done some demonic things, just to make sure the types are equal between db and schemas.
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
Thank you for the response! It totally makes sense and it's what I was afraid of. I will have to drop the drizzle-zod and create separate schemas then. Fortunately in this project it shouldn't be a problem, but in a more complex one that would be a pain in the ass I feel like. (I will spend some time to check, if there is no other solution to that). + Moving things like enums to the schemas package and then importing it in database would probably make sense to have a single source of truth at least for that.
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
No description
15 replies
DTDrizzle Team
Created by nightspite on 10/11/2023 in #help
exclude models from bundle
After excluding the database package from client via custom webpack config in next it now won't find the neccessary packages
webpack: (config, { isServer }) => {
if (!isServer) {
config.module.rules.push({
test: /database/,
use: 'null-loader',
});
webpack: (config, { isServer }) => {
if (!isServer) {
config.module.rules.push({
test: /database/,
use: 'null-loader',
});
15 replies