Unable to connect to DB
Thank God there is a Discord server xD
I been trying to make this work for like 2 hours and I can't get it to work
Solution:Jump to solution
There are a few approaches:
https://kysely.dev/docs/recipes/schemas
1. WithSchemaPlugin to apply schema globally to all queries.
2. withSchema method to apply to specific queries on the fly....
Working with schemas | Kysely
First of all, when we talk about schemas in this document, we mean custom
22 Replies
Hey 👋
What errors are you getting?
my db variable returns an empty object
so all the functions I run on it don't work cuz it's an empty object that doesn't contain those functions
for example,
selectFrom
its a class instance, without toString, toJSON, etc. implementation and no regard for enumarable keys. It doesn't mean the functions don't exist on it when you print it 🙂
ok
my knowledge isn't too vast so excuse me if its an easy fix
All good, we all learn each day
xD
this shouldn't work. it's not kysely code. Also Kysely has an introspection module that returns all tables.
the reason I had this code was because I keep getting the error that
https://kysely-org.github.io/kysely/classes/Kysely.html#introspection this exists on db and has functionality to get all tables metadata
Kysely | kysely
Documentation for kysely
I keep getting this error
this is a TRPC error
oops
one second
I noticed a small mistake
this is my TRPC endpoint code
I am making the api call using TRPC but it's this function that isn't running
relation User does not exist means that table is not in your database
right, but I do have it in my db
![](https://cdn.answeroverflow.com/1117142638378889335/image.png)