Titan
Explore posts from serversDTDrizzle Team
•Created by Titan on 11/4/2024 in #help
pgTable This overload is deprecated. Use the other method overload instead.
2 replies
[solved] Vue app aliases are not allowed in server runtime
How do I go about debugging this error? I've been through all my
server/
files and checked I'm not importing anything from the client or Vue based and the error doesn't give any more hints about where the problem is.9 replies
How to "mock" an H3 request with query string
I'm writing some unit tests for my "useValidatedQuery/useValidatedBody" functions that take a yup schema and validate the request.
I've got this working fine for the body with:
✅ this works
However I cannot get it work with the query string, I just can't work out the shape of the event, I've tried it in all the below places and none of them seem to work:
❌ none of these work
The function it gets passed into is the H3
getQuery
function:
const query = getQuery(event)
currently returning empty object2 replies
DTDrizzle Team
•Created by Titan on 6/28/2024 in #help
Multiple FROM support (word_similarity) fuzzy search
I'm trying to create this SQL:
Here's what I have, but Drizzle doesn't like the
sql${user}
:
Your "id" field references a column "app-user"."id", but the table "app-user" is not part of the query! Did you forget to join it?
1 replies
CDCloudflare Developers
•Created by Titan on 6/26/2024 in #general-help
Custom hostnames for SaaS timing out
13 replies
DTDrizzle Team
•Created by Titan on 5/31/2024 in #help
Not possible to add a new column to schema with drizzle migrate push (pg)
I'm adding a new column to my schema and running
drizzle-kit push
connecting to a postgres db
It never adds the new column. However if the new column contains a foreign key constraint it will attempt to add that, but will of course fail because the column hasn't been created.
This has never worked in the few months I've been using drizzle kit, perhaps I'm missunderstanding the purpose of push
? Does it not handle column level modificatons only new tables?1 replies
Dynamic/computed layout without causing content shift or re-render after route change
In my app.vue I'm using dynamic layouts to avoid having to specify the layout in every page:
However when switching from /auth to /platform you see a noticable shift in the content as the layout switches after the page has rendered.
This re-rendering also breaks automated e2e tests as it attempts to fill in forms while the shift is happening.
Is there anyway to make the layout change blocking or apply before the next
<NuxtPage />
renders
I assume it's because the computed watcher on useRoute is just updating too slow.
Can it be set in the middleware maybe?2 replies
DTDrizzle Team
•Created by Titan on 4/26/2024 in #help
Return type is only "with" types, ignores "columns" types
Not sure if I'm using it wrong but the return type of a relational query is just the columns from the "with" clause, and doesn't merge with the "columns" object like I'd expect
3 replies
DTDrizzle Team
•Created by Titan on 4/8/2024 in #help
Insert returning api to match select columns
8 replies
Supress <Suspense> warning, adds lots of console logs in tests
How do I hide the
<Suspense> is an experimental feature and its API will likely change.
message in Nuxt 3? When unit testing it appears many times for each test which is pretty frustrating7 replies
Can Nuxt Hub features be used outside of the base template?
Reading CF's announcement today:
https://blog.cloudflare.com/blazing-fast-development-with-full-stack-frameworks-and-cloudflare
And realising this sounds a lot like what you guys are doing in Nuxt Hub, is there a way to utilise parts of it, say the D1 or R2 functions, without opting into all the core when I already have my own base application? E.g it wouldn't also be importing a bunch of irrelevant code from core that my app wouldn't utilise?
Thanks, it's not quite clear how standalone some of the Nuxt Hub features are.
1 replies
SOLVED: How to create server middleware just for API routes?
I'm trying to create middleware for my server API routes, but I've found they also run on SSR mode when trying to render the client, which has nothing to do with my API. How do I target just API H3 routes with middleware?
3 replies
Nuxt server API on subdomain
For native app reasons I need my Nuxt API routes to be on a subdomain of the Nuxt FE root domain. Has anyone done this before? In my head I feel like the solution is to just deploy the entire thing twice to both the root domain and subdomain and change the base URL for the API to point to the subdomain
9 replies
DTDrizzle Team
•Created by Titan on 2/28/2024 in #help
Type for schema when creating db client
I get the following typescript error whenever I try to include
{ schema }
into my db creation:
```
Type 'LibSQLDatabase<typeof import("server/database/schema")>' is not assignable to type 'BetterSQLite3Database | LibSQLDatabase<Record<string, never>> | null'.
Type 'LibSQLDatabase<typeof import("server/database/schema")>' is not assignable to type 'LibSQLDatabase<Record<string, never>>'.
The types of '.schema' are incompatible between these types.
Type 'ExtractTablesWithRelations<typeof import("server/database/schema")> | undefined' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>> | undefined'.
Type 'ExtractTablesWithRelations<typeof import("server/database/schema")>' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>>'.
Property 'todos' is incompatible with index signature.
Type '{ tsName: "todos"; dbName: "todos"; columns: { id: SQLiteColumn<{ name: "id"; tableName: "todos"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; userId: SQLiteColumn<...>; title: SQLiteColumn<....' is not assignable to type '{ tsName: string; dbName: never; columns: never; relations: Record<string, Relation<string>>; primaryKey: AnyColumn[]; }'.
Types of property 'dbName' are incompatible.
Type 'string' is not assignable to type 'never'.```10 replies
CDCloudflare Developers
•Created by Titan on 2/13/2024 in #general-help
Port 80 on my origin, but SSL via cloudflare
I'd like to keep using port 80 on my non-important origin apache server, and I was under the impression if I proxied the DNS via CF, CF could provide https for the domain for client->CF communication and get CF to communicate with my origin server on port 80. I've got SSL set to flexible, but CF can't seem to connect. Is there a way to tell CF to communicate with the origin on port 80 always?
10 replies