oof2win2
Explore posts from serversDTDrizzle Team
•Created by oof2win2 on 10/9/2024 in #help
Cannot use pgEnum with aws aurora
Hi. I can't seem to use
pgEnum
with the AWS aurora adapter, as i keep getting the same error over and over. It seems weird, as intellisense doesn't say that the types are wrong at all when i am doing the update query, but pg returns an error
ERROR: column "status" is of type "EmailStatus" but expression is of type text; Hint: You will need to rewrite or cast the expression.; Position: 31; SQLState: 42804
3 replies
CDCloudflare Developers
•Created by oof2win2 on 9/30/2024 in #general-help
Migrating to a new account
Hey there. I want to migrate my current Cloudflare projects (domains, workers, D1, Stream) all to a new account. Is this possible without too much downtime and data loss?
1 replies
Implementing D1 batching (getting typed queries as input and returning typed InferResult)
Hi. I've wanted to get D1 batching to work, so I've tried doing as below. Functionally the code works, however I would like to get the proper type safety for this. Essentially I extend Kysely to add the
executeBatch
method and I want to infer the results for each of the individual queries. Is this possible?16 replies
DTDrizzle Team
•Created by oof2win2 on 8/20/2024 in #help
Joins with the Query API
Hi. I want to use .query to have nested queries for subitems, but i would also like to execute table joins within the API. Is it possible to achieve this somehow?
1 replies
DTDrizzle Team
•Created by oof2win2 on 8/18/2024 in #help
drizzle-kit libsql extensions
hi. i want to ask if it is possible to add the extensions to drizzle-kit's libsql, mainly altering existing columns on tables. the issue is that drizzle-kit generates a migration with a generic message, where it doesn't specify which columns have changed so i can't even alter the columns myself. is there a way to add in an implementation of altering columns so that drizzle can use it, or at least getting drizzle to log the change that should be performed so that i can write the query myself?
1 replies
Accessing underlying methods on the client
Hi. I'm using libsql and I want to batch statements to be sent to the database. The underlying clients have these methods implemented, so I was wondering if it were possible to access these underlying methods from the
Kysely
class itself, or if it is necessary for me to write my own extension of the class to achieve this7 replies
Update on conflict clause
Hi. I need to use the on conflict clause in an update query within sqlite. I've searched the docs in mysql and it isn't present there. I created an example below for replication of the desired behavior. The only thing that I can think of is using the template sql`` operator from kysely, but is there a better way?
4 replies
CDCloudflare Developers
•Created by oof2win2 on 4/14/2024 in #workers-help
how to setup rpc/entrypoints with workers for API access?
hi. so i have an api that is structured as below, and i was wondering how i would represent it within rpc or entrypoints. do i create a base entrypoint and make the rest RPC targets that can be used with a getter (option 1, doesn't seem too difficult), or can i create it with option 2 using classes on the base api class?
11 replies
can kysely be extended with custom types within the database
hi. i would like to extend my database with custom types (a date type for sqlite) so that it is easier to work with. i would assume that conversion to sql would be easy since its just a stringify operation using sql template tags, but is there a way to automatically convert from the database results, i.e. parse a ISO string into a Date object?
5 replies
building kysely makes the package size very large
hi. i'd be more than happy to figure this out because i like kysely a lot more than drizzle. the thing was that the package size was so much larger with drizzle. i made a repro here. when running
bun build --minify --outfile
, i get kysely to be 340.40kB whilst drizzle is 55.35kB, meanwhile the functional code besides the database is identical78 replies
Querying on jsonArrayFrom
Hi. So i need to fetch posts with comments from a database that are written by a set group of authors and have comments that are written by a set group of people. How would I accomplish this with sql? The best thing I can think of is fetch all posts and comments where the posts are written by the authors, and then do further clientside filtering on the comments - but is there a way to do this with the sql itself?
7 replies
transforming database values to JS values (dates in sqlite)
hi. is it possible to transform database values with any driver into any JS value? such as integers to timestamps on specified columns? i want to do this for sqlite and other databases but idk how
4 replies
Support for D1 batching
Hi. I'm wondering about support for batching statements with Cloudflare's D1 batching, similar to libsql's batching - i.e. multiple statements are sent and processed at once similar to a transaction, except it all occurs within the database driver itself. Can I somehow go about extending kysely or my dialect to add support for this? I.e. some dialect-specific functions i guess?
4 replies
CDCloudflare Developers
•Created by oof2win2 on 1/3/2024 in #general-help
image and video storage
so i want to create a image and video backup solution and host it somehow on cloudflare. is that realistic? i would quickly run out of R2 storage and would get to the paid tier. since i won't be reading the images very often (if at all), is there something else cloudflare offers that would suit me better?
3 replies
TTCTheo's Typesafe Cult
•Created by oof2win2 on 11/12/2023 in #questions
How to use Vercel edge config within limits (usage and theory, not code)?
Hi. How would I go about using Vercel edge config in theory? Like there is a limit of 50k reads per month, and to me that seems like not a lot to be honest - that's 50 thousand page views on a single page that uses it - so you would basically divide that by the amount of pages you have if the traffic is approximately the same. Am I understanding these limits correctly?
2 replies
Using a custom HTTP driver for Kysely
Hi. I want to use neondb as my database. The issue is that I can't create a PostgresDialect class instance from the default provided pool, as that uses websockets - which is not what I want. Is there a way to tell Kysely to use HTTP connections (such as with
kysely-planetscale
), or do I need to make the driver myself?7 replies
Is there a way to not have as many Selectable<> generics?
Hi. I'm using
prisma-kysely
to generate my Kysely types, and it generates them with the Generated generic. I therefore need to use the Selectable generic to change it to the return type of what is selected when I want to use the type. Is there a way to avoid using it so often?13 replies
Achieve Prisma-like nested selects
Hi. Is it possible to achieve Prisma-like nested selects with Kysely? I have the following code and it has the type below in Prisma, but I'm not sure how to achieve the same in Kysely without just doing an additional
select * from CommitteeCountry where id in (select id from Committee)
or something along those lines and then mapping the results in JS
15 replies