Figuring out where in codebase an exception originated from
.execute()
call threw a SQL exception? I know ideally I should be doing error handling on each call, but I have a large codebase and I'm not sure where this error is coming from. Is there any easy way of figuring this out? Maybe a way to have a wrapper that prints out the query if malformed, or to print out the stack trace where the original call was executed?
```
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1. Trace: Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1...How to insert into all values (and columns) from another table / view?
Triggers vs stored procedures
updatedAt
and lastLogin
updated on their own from the Model below ```ts
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now()) @db.Date
updatedAt DateTime @db.Timestamp() ...`Selectable`, `Insertable` and `Updateable` wrappers
export type Person = Selectable<PersonTable>
export type NewPerson = Insertable<PersonTable>
export type EditedPerson = Updateable<PersonTable>
export type Person = Selectable<PersonTable>
export type NewPerson = Insertable<PersonTable>
export type EditedPerson = Updateable<PersonTable>
How to sort by random?
orderBy(sql`random()`)
orderBy(sql`random()`)
Using jsonArrayFrom with mariadb.
insert data into a table that has id of type bigserial
Unable to connect to DB
Limit with a literal value
Prisma-kysely generator converts boolean to a number
prisma-kysely
, the generated type for a prisma Bool appears to be a number for some reason. Is this correct?Is there a way to not have as many Selectable<> generics?
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?insertId return by transaction
How can I use Kysely migration inside NextJS 13 project?
i am trying to select my id from type uuid
I am getting an error when entering an id with a uuid value
uuid
using sql
template tag:
```ts...How can i enable postgres Extensions (eg: uuid) with in Kysely Migration File
create extension "uuid-ossp";
;
how to execute this raw query inside migration file up method....execute
like this:
```ts...Unable to insert geometry Postgres
point
data into my Postgresql table but getting error: parse error - invalid geometry
error. Here is the code ...Achieve Prisma-like nested selects
select * from CommitteeCountry where id in (select id from Committee)
or something along those lines and then mapping the results in JS
```ts
const data = await prisma.Committee.findMany({
include: {
countries: true,...Why is numUpdatedRows a BigInt?
InsertObject
needs to be a bigint. Therefore all the others are too....