yoggyd
Explore posts from serversany reason against using the deps.ts approach?
It seems that the
Deps.ts
approach is not recommended anymore since jsr - however I fail to see why. What's the benefit of using the import map and falling back into the package.json problems instead of having a Deps.ts file? The only thing I can see is that the module specifiers can thus be compatible with non-deno code...7 replies
how to disable no-window rule
adding it to "no-window" to deno.json.lint.exclude does not work.
While I can appreciate the sentiment behind this rule and using globalThis should be preferred there is apparently no way for globalThis to be extended in ambient contexts - i.e. when you're writing a library and want to attach something to globalThis without having to assert its type every time. So using window is afaik the only way to achieve this and having deno tell me "hey, window won't be available" is not helpful here... especially when I know that it will be available.
3 replies
how to use Untar without deprecated functions?
Untar
from std/archives requires an instance of Reader
- apparently most functions return some ReadableStream though. I only found a function in std/streams to convert a ReadableStream to a Reader. That function is deprecated though and will be removed in 1.0.0. What can I use instead? Or will the Untar
class take a ReadableStream in 1.0.0?
EDIT:
the deprecated function: https://deno.land/[email protected]/streams/mod.ts?s=readerFromStreamReader
the Untar
class: https://deno.land/[email protected]/archive/mod.ts?s=Untar2 replies
DTDrizzle Team
•Created by yoggyd on 9/21/2023 in #help
totalCount from relational query
is it somehow possible to get the total count of a relational query?
Core queries aren't possible here due to a bug in how drizzle builds the column identifiers (multiple columns have the same name here and duplicates are discarded, resulting in
undefined
values)
I thought maybe I could utilize CTEs here but then how would I get the benefit of relational queries?
Is string manipulation really the only option here?1 replies
DTDrizzle Team
•Created by yoggyd on 9/19/2023 in #help
many to many self reference
I'm trying to define "follows" & "followers" relations on a user entity. Obviously this is a many to many relation, but how to I define both "edges" in my relation?
I've seen
many
takes a config param relationName
but I don't see where I can define that the relation "follows" references followsUserId
and "followers" references userId
?10 replies
DTDrizzle Team
•Created by yoggyd on 8/14/2023 in #help
sqlite code first with in-memory db
Hey, I thought it'd be rather easy to create a schema from scratch without running a "migration" (from nothing to v1 is a migration?), but apparently I was wrong. I'm using bun:sqlite and would prefer to not create some migration files or whatever.
Shouldn't
db.run(table.getSql())
work? Is there even an option to bootstrap a schema without creating additional files?1 replies