-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get ID after inserting row #35
Comments
Looks awesome :O I will try to implement it tomorrow. |
Thanks! |
|
@wwwouter You should also implement this for |
@bgilman-nyk I added this to v4.5.0. Can you check if this is what you actually need? |
@wwwouter I see the change on your repo. Exactly what we need! But when I grabbed latest from npm, it looks like while the |
Not sure what went wrong. Can you try v4.5.1? |
Fantastic, thank you! |
@Meldiron Can this be closed? |
@wwwouter I think the types of these functions don't match what they actually return. For example, if I have some table with an aliased ID field: @Table("foo")
class Foo {
@Column({ primary: true, name: "foo_id" })
id: number
// ...
} If I do Seems like either the types should be changed to reflect that, or the functions should be changed to alias the returned columns back to their property names |
I see the alias mapping is omitted. Will fix. |
@bam365 Could you check to see if it works in v4.7.0? |
Issue type:
[X] Question
[ ] Bug report
[X] Feature request
[ ] Documentation issue
Database system/driver:
[ ] Postgres
[ ] MSSQL
[X] MySQL
[ ] MariaDB
[ ] SQLite3
[ ] Oracle
[ ] Amazon Redshift
typed-knex version:
[X]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Is it possible to get ID of the last inserted row? Knex itself has
.returning('id')
but typedKnex always returns void withinsertItem
so I could not find a way to achieve this.The text was updated successfully, but these errors were encountered: