Sqlite insert returning typing help

Been using this lots for PG but trying now with Sqlite. I'm confused by how tog et the returned object after inserting. It's not super clear from the docs:
const _company = db
.insert(companies)
.values({
id: company.id,
name: company.name,
})
.returning();

_company.run(); // ???
const _company = db
.insert(companies)
.values({
id: company.id,
name: company.name,
})
.returning();

_company.run(); // ???
According to this, I can just use .returning() but the type for that looks like the table object, not the record that would be returned.
3 Replies
McLean 25
McLean 25OP2y ago
These are the properties I'm seeing:
Andrii Sherman
I assume you need to use .all() after returning()
McLean 25
McLean 25OP2y ago
Oh that's it, thanks!
Want results from more Discord servers?
Add your server