itsyoboieltr
itsyoboieltr
Explore posts from servers
DTDrizzle Team
Created by itsyoboieltr on 11/3/2024 in #help
Does eslint-plugin-drizzle work with the new eslint.config.js and eslint 9?
I could only find docs about the legacy eslint config format
2 replies
Aarktype
Created by itsyoboieltr on 9/8/2024 in #questions
Creating default object from type definition
Hi! I would like to migrate my project from TypeBox to ArkType, as I love the work you're doing on it, and the development experience seems much better. There is one feature that I love in TypeBox, but couldn't find in ArkType: creating a default object from a type definition. Is this something that exists or was ever raised/considered? I would find this feature very useful to create the initial state of a form, without any code duplication. Example syntax:
import { type } from 'arktype';

export const userType = type({
name: 'string',
device: {
platform: "'android'|'ios'",
'version?': 'number',
},
});

const user = userType.create();
console.log(user)
// {name: '', device: {platform: 'android'}}
import { type } from 'arktype';

export const userType = type({
name: 'string',
device: {
platform: "'android'|'ios'",
'version?': 'number',
},
});

const user = userType.create();
console.log(user)
// {name: '', device: {platform: 'android'}}
23 replies
TtRPC
Created by itsyoboieltr on 7/9/2024 in #❓-help
Cron job with tRPC
can I make a cron job using tRPC? I would like a tRPC endpoint to be called periodically by the same Next.js application that also hosts the tRPC api, meaning I cannot use an external service to make the request to the app. Is this possible somehow? In plain typescript, this would be something like a setInterval function that would call the server side function caller every n seconds.
2 replies
SSolidJS
Created by itsyoboieltr on 11/30/2023 in #support
Is there a way to use the <For> component with an array of inputs?
everytime I type in one if the inputs output by <For>, I lose focus, because it gets rerendered 😦
4 replies
DTDrizzle Team
Created by itsyoboieltr on 11/30/2023 in #help
eslint-plugin-drizzle add "db" as default
Is there a reason why it is automatically applied for every delete function? I think most users would use "db" const anyway. If you decide not to make "db" default, can we somehow override this for all rules? it sounds very cumbersome to specify this for every rule (imagine if even more get added in the future)
28 replies
SSolidJS
Created by itsyoboieltr on 11/25/2023 in #support
createStore default value with anonymous function
In react I would do something like:
const [array, setArray] = useState(() => {
/* some computation */
return [...data];
});
const [array, setArray] = useState(() => {
/* some computation */
return [...data];
});
Can I do something similar with solid?
6 replies
DTDrizzle Team
Created by itsyoboieltr on 11/19/2023 in #help
optional join
it would be nice if we could do something similar to the where function, where if we return undefined, nothing happens, to do optional joins.
8 replies
DTDrizzle Team
Created by itsyoboieltr on 11/13/2023 in #help
Full-text search on jsonb column
Hey, I was experimenting with full-text search and drizzle. I saw in the docs an example for full-text search https://orm.drizzle.team/docs/sql, but this seems to only work with text columns. How would I convert the where statement to make it work with jsonb? @Angelelz
10 replies
DTDrizzle Team
Created by itsyoboieltr on 11/7/2023 in #help
Is there any way to call drizzle-kit with the new node --env-file=.env argument?
Hey, since node supports env files since pretty recently, it would be nice if we could ditch dotenv. Now I only require dotenv to inject the environment variables to drizzle.config.ts to allow drizzle-kit to db push 😄
4 replies
DTDrizzle Team
Created by itsyoboieltr on 10/19/2023 in #help
Drizzle typebox enum array not working
I am making this post to raise some attention to an issue I made around 2 weeks ago on GitHub. https://github.com/drizzle-team/drizzle-orm/issues/1345#issuecomment-1771082418 The typebox schema and types generated for enum arrays is wrong. It seems like it would be fairly simple to fix, I hope this can be investigated soon 😄 Probably this is also connected https://github.com/drizzle-team/drizzle-orm/issues/1110
10 replies
DTDrizzle Team
Created by itsyoboieltr on 10/6/2023 in #help
Is it possible to use the "unaccent" extension with drizzle?
hello, I wanted to make an ilike comparison in my query for the letter %á%, but it does not match for %Á%, because afaik, they are regarded as two different letters by postgres. I asked chatgpt, who told me to use the "unaccent" extension to remove the accents before the comparison to get good results. Is this really the way to go? If yes, how could I integrate it with drizzle? I just want to query usernames without worrying about casing :DD
18 replies
SSolidJS
Created by itsyoboieltr on 10/3/2023 in #support
React.isValidElement(element)
Is there a similar function in solid?
3 replies