zikk
zikk
Explore posts from servers
DTDrizzle Team
Created by zikk on 4/5/2024 in #help
How to stop drizzle-kit push from truncating every time ?
As the title says, some column changes make the query have unnecessary truncates. Also, i have a pg timestamp(3) field and the push every time shows me this You're about to change created_at column type from timestamp(3) to timestamp (3) with <x> items
2 replies
DTDrizzle Team
Created by zikk on 4/4/2024 in #help
Create query inserts quotes for customType with push
Hey people. So i am using PostGIS as my database, and i created a custom type for the geogrraphy point
export const geoPoint = customType<{ data: never }>({
dataType() {
return "geography(Point, 4326)";
},
toDriver(value: Point) {
return sql`ST_MakePoint(${value.latitude}, ${value.longitude})`;
},
});
export const geoPoint = customType<{ data: never }>({
dataType() {
return "geography(Point, 4326)";
},
toDriver(value: Point) {
return sql`ST_MakePoint(${value.latitude}, ${value.longitude})`;
},
});
The issue lies when i use drizzle-kit push, it makes a create query that puts the type inside quotations marks (which breaks the db query) How do i make it so that it creates the DB creation query correctly ?
...
"coords" "geography(Point, 4326)" NOT NULL,
...
...
"coords" "geography(Point, 4326)" NOT NULL,
...
error: type "geography(Point, 4326)" does not exist
error: type "geography(Point, 4326)" does not exist
2 replies
RRailway
Created by zikk on 2/16/2024 in #✋|help
Databases randomly crashing
I have two databases in two different projects with different issues: 1- i migrated a database with the migration tool, it worked without a hitch untill i changed up some variables. after that it started crashing every time after it redeploys. The issues is i rolled back to a previous version and it works fine (with the new variables supposedly) 2- I tried cloning my current DB in PG on my other project, but it went above the 5GB limit, now it crashed on every redeploy and i have no way to fix it
58 replies
TTCTheo's Typesafe Cult
Created by zikk on 7/1/2023 in #questions
Deep react component typing
hey ts nerds, can someone help me out with this ?
export namespace StyledButton {
declare const SSpinner: import('styled-components').StyledComponent<Spinner, any, {}, never>;
declare const SButton: import('styled-components').StyledComponent<'button', any, SButtonProps, never> & {
Arrow: import('styled-components').StyledComponent<'span', any, SButtonArrowProps, never>;
}
// declare namespace SButton {
// declare const Arrow: import('styled-components').StyledComponent<'span', any, SButtonArrowProps, never>;
// }
declare const ButtonGroup: import('styled-components').StyledComponent<'div', any, ButtonGroupProps, never>;
}
export namespace StyledButton {
declare const SSpinner: import('styled-components').StyledComponent<Spinner, any, {}, never>;
declare const SButton: import('styled-components').StyledComponent<'button', any, SButtonProps, never> & {
Arrow: import('styled-components').StyledComponent<'span', any, SButtonArrowProps, never>;
}
// declare namespace SButton {
// declare const Arrow: import('styled-components').StyledComponent<'span', any, SButtonArrowProps, never>;
// }
declare const ButtonGroup: import('styled-components').StyledComponent<'div', any, ButtonGroupProps, never>;
}
When using this typing, <StyledButton.Sbutton /> works and the editor autocompletes and reads it well, but when i try <StyledButton.SButton.Arrow /> i get not help it's not working (with both methods, the one used or the one commented the whole
export declare const SButton: import('styled-components').StyledComponent<'button', any, SButtonProps, never> & {
Arrow: import('styled-components').StyledComponent<'span', any, SButtonArrowProps, never>;
}
export declare const SButton: import('styled-components').StyledComponent<'button', any, SButtonProps, never> & {
Arrow: import('styled-components').StyledComponent<'span', any, SButtonArrowProps, never>;
}
alone isn't working as i wanted it, i've seen it done like that though (in the mantine .d.ts files on their input component) Edit: if i declare it like this it works
declare const SButton: React.FC<SButtonProps> & { Arrow: ..whatever }
declare const SButton: React.FC<SButtonProps> & { Arrow: ..whatever }
This is probably due to the fact that when i install this package in another project it doesn't get styled-components typing somehow Edit 2 : figured out the "solution", add the styling package as a peer depency so the used of the package has to install it, i don't know if better can be done though
2 replies
RRailway
Created by zikk on 9/1/2022 in #✋|help
PostgresQL eating up too much RAM
my Postgresql DB instance averages 3GB of RAM use for like 8 open connections and just a couple of requests a day. It's way too much, i noticed that because of that i've been overpaying for a while alrady. Project ID : e40da83a-cffa-4c89-a560-e1b51f20a45c
61 replies
RRailway
Created by zikk on 9/1/2022 in #✋|help
Postgres DB eating too much RAM
I just got my monthly billing and it seemed too high, and my PG DB uses an average of 3GB of RAM. I thought my bill was a little hight before, but now it seems ludicrous. I have a couple of open connections to the database and my app use is close to none
19 replies