NazCodeland
Explore posts from serversKPCKevin Powell - Community
•Created by NazCodeland on 6/9/2024 in #front-end
Breaking out a descendent
Hey everyone, I've got this https://codepen.io/bbonsaye/pen/mdYMpKe
I'm trying to make the
section
element take up the space given to the named grid column breakout
.
If I make it a sibling to article
it can be done but I am wondering if I can do this while section
is a descendent of main
? I even tried doing it by applying subgrid
to article
but I just learned that article
only aligns it's own grid lines to the parents grid lines, and doesn't inherit all of the parents grid lines.1 replies
CDCloudflare Developers
•Created by NazCodeland on 4/6/2024 in #workers-help
storing stateful WebSockets connection
Hey everyone, so, I am just learning that "stateful objects" can not be stored in a Database, like D1 or any other Database. KV won't work because it can only store string values.
I'm learning that
stateful connections
in programming are stored in the memory of the running application.6 replies
CDCloudflare Developers
•Created by NazCodeland on 4/4/2024 in #workers-help
How access 'env' in the WebSockets Template
Hey, I've got a Cloudflare Worker that implements WebSocket connection. The implementation is from: https://github.com/cloudflare/websocket-template
I am wondering how can I access the
env
variable that is usually available to us when we use the syntax instead of the one used in the template, 8 replies
CDCloudflare Developers
•Created by NazCodeland on 4/2/2024 in #workers-help
`wrangler tail` with WebSockets
Is this not true for any incoming Websocket requests? - I have a console log inside of the
websocket.addEventListener("message"
in the websocket template on Cloudflares Github pages and I've noticed that it doesn't log those live, only when you close the connection do all the logs show up14 replies
CDCloudflare Developers
•Created by NazCodeland on 1/5/2024 in #pages-help
Nodemailer
Hey everyone, I've got a website that deploys to Cloudflare Pages but ever since I've added a form that uses Nodemailer, my deployment is failing. It's because CloudFlare Pages environment doesn't support all Node.js modules. Is there a work around this without using third party email senders?
1 replies
CDCloudflare Developers
•Created by NazCodeland on 12/31/2023 in #pages-help
Page address for GitHub Repository not working
Hey everyone, I've created a Cloudflare Page using my Github Repository and was able to
build
successfully, however, when I go to the link given for the project, saigon.pages.dev
it does not work.30 replies
Transaction response time
Hey everyone, in my code I have a
createUser(), createProfile(), createBusiness(), and createAddress()
for this example.
Currently, I have creaeUser()
execute on it's own and then the other 3 free functions execute as one transaction. Which gives me the benefit of having a fast response time for when a user creates an account. (the loading screen is quick) but I don't know if that benefit outweighs the risk of having user records in the database without a profile, business, and/or address
records - *if for some reason the transaction fails but the createUser()
executed fine.
I really like the fast signup user experience provided by just awaiting createUser()
without having to wait for a whole transaction to complete. Is there any way to handle this scenario other than optimizing the functions within the transaction as much as possible?49 replies
Making Transactions with KyselyAdapter for auth.js
Hey everyone, I am using this KyselyAdapter package for auth.js https://github.com/nextauthjs/next-auth/pull/5464
I made slight changes since I am in a SvetleKit project and it works!
This package returns and object of functions, each function creates, updates, deletes a record in the database.
I am not sure how I would go about using these functions to create a transaction. Prior to using this package, I wrote my own KyselyAdapter for auth.js but in ( for it wasn't working in some situation, so I switched ) but this is how I wrote a transaction using my own KyselyAdapter
I realize the purpose of https://github.com/nextauthjs/next-auth/pull/5464 is to be used with auth.js - and it serves that objective
But for me to write a transaction like the above code snippet, I would have to modify that packages code - which I don't want to do
14 replies
CDCloudflare Developers
•Created by NazCodeland on 7/29/2023 in #workers-help
console.log(request) doesn't show shape of request
Hey everyone, I have a local environment running,
wrangler dev
In my worker script, I have console.log(request)
and in the terminal all I see is 17 replies
CDCloudflare Developers
•Created by NazCodeland on 7/23/2023 in #workers-help
unable to access cli in worker editor
9 replies
CDCloudflare Developers
•Created by NazCodeland on 7/21/2023 in #workers-help
"Token and remote not found"
10 replies
Best practice around building query functions
Hey, I've looked around the docs somewhat but still not confident if I should do this:
Say, I have a
createUser
function, and then I need access to that returned user object within createProfile
. I could also create a findUserById()
function like in the docs, and call findUserById()
within createProfile()
but then I would have to pass the userObject or user.id to createProfile(), which is fine, but before I start implementing it this way, I figure I should ask if this is the ideal way or is there a better way29 replies
Declaring types under 'kysely-codegen' module
Hey everyone, because I'm using Prisma to push schemas to my database (it's because my Zod Schemas) also getting generated from my Prisma schemas -- it's why I'm still using it incase you're wondering why I'm in this situation:
I have a
./types/kysely-codegen.d.ts
file which contains
in another file I have
BaseUser
gives me the error that 19 replies
From Prisma Model to Kysely Schema
Hey everyone, I'm using this package https://github.com/valtyr/prisma-kysely, the output of this Prisma Model is
so when I have Kysely code such as
8 replies
Triggers vs stored procedures
Hey everyone, I don't think this is related to Kysely directly, so excuse me but this is the only SQL type of server I am in. I am wondering what is the best way to automatically update a table attribute based on when another attribute changes (in the same table or another table). For example, if I want to have the attributes
updatedAt
and lastLogin
updated on their own from the Model below
I need these values determines automatically. I have some sources saying use Triggers and some saying just have functions that you can invoke yourself in server side logic.
Based on an article, this seems to be the main con of triggers
and the main pro seems to be that whereas, functions on the server have a chance of not running due to an errorr occuring right before the attributes updatedAt
, lastLogin
are updated14 replies
`Selectable`, `Insertable` and `Updateable` wrappers
Hey everyone, I am using this package: https://github.com/valtyr/prisma-kysely and I noticed that the output file does not include
for the tables that I have in my schema, I don't know if that's not required because of my setup or if that is still required, I opened an issue in the repo but figured I ask here too
39 replies
merging other routers to appRouter
Hey everyone, I am using the https://icflorescu.github.io/trpc-sveltekit package in my SvelteKit project. My question is not related to that package (at least I don't think it is) I figured I mention it since it might be related and I just don't know...
I am wondering if I have this code,
and say I also have
am I able to merge the
userRouter
onto the appRouter
directly within the /router/user.ts
file?7 replies