Lautaro_dapin
Lautaro_dapin
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 10/2/2023 in #questions
Database migrations
yep i have see the kysely migration cli with the prisma to kysely, it helps
9 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 10/2/2023 in #questions
Database migrations
thats a agresive and unuseful answer ... thanks a lot for the help 🙂
9 replies
TTCTheo's Typesafe Cult
Created by piesell on 4/8/2023 in #questions
Using Google Cloud SQL with Prisma
did you manage to solve this? @piesell im havving a similar issue
2 replies
DTDrizzle Team
Created by Mendy on 7/15/2023 in #help
How to update multiple rows with one query?
most orms use CASE WHEN for updating you could investigate that
6 replies
TTCTheo's Typesafe Cult
Created by alan on 6/27/2023 in #questions
t3 app in turborepo now throws 404 error when accessing root
why are you on port 3002? you dont have any config to change the next default port
7 replies
TTCTheo's Typesafe Cult
Created by camdressler on 6/27/2023 in #questions
env-nextjs error
show some codse
4 replies
TTCTheo's Typesafe Cult
Created by alan on 6/27/2023 in #questions
t3 app in turborepo now throws 404 error when accessing root
you should show some files for people to help next.config.js package.json turbo.json [tprc].tsx utils/api.ts
7 replies
DTDrizzle Team
Created by hachoter on 6/11/2023 in #help
I need some guidance on joins
the doc doesn't specified that, but it seems that is oonly a layer on top of the oooriginal lib, so it should you could add a logger on your db and see it for yourself
7 replies
DTDrizzle Team
Created by hachoter on 6/11/2023 in #help
I need some guidance on joins
and this is new https://orm.drizzle.team/docs/rqb#querying maybe that helps
7 replies
DTDrizzle Team
Created by hachoter on 6/11/2023 in #help
I need some guidance on joins
no way of doinng that, thats how sql works, its just a row, youu will have to do a reduce or map after that
7 replies
DTDrizzle Team
Created by Lautaro_dapin on 6/6/2023 in #help
Sveltekit Failed to resolve import "cloudflare:sockets"
@Maston lool, i'm so stupid, i was putting the load function in the server/cliennt instead of the page.server.ts xD
7 replies
DTDrizzle Team
Created by Lautaro_dapin on 6/6/2023 in #help
Sveltekit Failed to resolve import "cloudflare:sockets"
I will try that thanks
7 replies
DTDrizzle Team
Created by Lautaro_dapin on 6/6/2023 in #help
Sveltekit Failed to resolve import "cloudflare:sockets"
The project is only a svelkite project template with the following changes
// routes/+page.ts
import type { PageLoad } from "./$types";
import { db } from "$lib/drizzle"

export const load: PageLoad = ({ fetch })
return { hola: "mundo" }
}
// routes/+page.ts
import type { PageLoad } from "./$types";
import { db } from "$lib/drizzle"

export const load: PageLoad = ({ fetch })
return { hola: "mundo" }
}
// lib/drizzle.ts
import { pgTable, serial, text, varchar, integer } from "drizzle-orm/pg-core";
import { drizzle } from "drizzle-orm/node-postgres"
import { Pool } from "pg"
import { migrate } from "drizzle-orm/node-postgres/migrator"

export const kanbanColumns = pgTable('kanban_columns', {
id: serial('id').primaryKey(),
name: text('name').notNull(),
order: integer('order').notNull().default(0),
})

export const kanbanTickets = pgTable('kanban_tickets', {
id: serial('id').primaryKey(),
title: text('name').notNull(),
order: integer('order').notNull().default(0),
columnId: integer('column_id').references(() => kanbanColumns.id)
})

const sqlite = new Pool({
host: '127.0.0.1',
port: 5450,
user: "postgres",
password: "example",

})
export const db = drizzle(sqlite);


migrate(db, { migrationsFolder: "migrations" });
// lib/drizzle.ts
import { pgTable, serial, text, varchar, integer } from "drizzle-orm/pg-core";
import { drizzle } from "drizzle-orm/node-postgres"
import { Pool } from "pg"
import { migrate } from "drizzle-orm/node-postgres/migrator"

export const kanbanColumns = pgTable('kanban_columns', {
id: serial('id').primaryKey(),
name: text('name').notNull(),
order: integer('order').notNull().default(0),
})

export const kanbanTickets = pgTable('kanban_tickets', {
id: serial('id').primaryKey(),
title: text('name').notNull(),
order: integer('order').notNull().default(0),
columnId: integer('column_id').references(() => kanbanColumns.id)
})

const sqlite = new Pool({
host: '127.0.0.1',
port: 5450,
user: "postgres",
password: "example",

})
export const db = drizzle(sqlite);


migrate(db, { migrationsFolder: "migrations" });
couldnt figure up what was happening, I event add the cloudflare adaptor to the sveltekit.config.ts
// import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-cloudflare';

import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),

kit: {
adapter: adapter(),
}
};

export default config;
// import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-cloudflare';

import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),

kit: {
adapter: adapter(),
}
};

export default config;
7 replies
TTCTheo's Typesafe Cult
Created by deforestor on 5/30/2023 in #questions
Conditional render, why can't it be done?
@deforestor then tell me if it works xD
15 replies
TTCTheo's Typesafe Cult
Created by deforestor on 5/30/2023 in #questions
Conditional render, why can't it be done?
yep
15 replies
TTCTheo's Typesafe Cult
Created by deforestor on 5/30/2023 in #questions
Conditional render, why can't it be done?
typescript wiith jsx is not smart enough what you could do is inside the Loader component instead of return children, force to be a function where you pass the data something like this
function Loader(props){
if (props.isLoading || !props.data) return <>Loading...</>

return children(props.data)
}

function Page(){
...
return(
<Loader isLoading={isLoading} data={data}>
{data=> (<>{JSON.stringify(data)}</>))
</Loader>
)
}
function Loader(props){
if (props.isLoading || !props.data) return <>Loading...</>

return children(props.data)
}

function Page(){
...
return(
<Loader isLoading={isLoading} data={data}>
{data=> (<>{JSON.stringify(data)}</>))
</Loader>
)
}
not tested but should work i think xD
15 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 2/17/2023 in #questions
Middleware doesn't load the `server.mjs` variables
thanks @cje it was the old env version for the project I had the env folder with the schema server and client I removed it and coopy the new env.mjs into the /src folder and it work perfectly
9 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 2/17/2023 in #questions
Middleware doesn't load the `server.mjs` variables
i create this project 2 weeks ago idk how much it changed
9 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 2/17/2023 in #questions
Middleware doesn't load the `server.mjs` variables
i will try that,
9 replies
TTCTheo's Typesafe Cult
Created by Lautaro_dapin on 11/23/2022 in #questions
T3 Stacks requires internet?
@Pod not really, i just created a sqlite3 db (i wasn't using the auth plugin)
6 replies