planetarydev / json-sql-builder2

Level Up Your SQL-Queries
MIT License
75 stars 21 forks source link

Feature request: add function LAST_INSERT_ID() #36

Closed yanickrochon closed 4 years ago

yanickrochon commented 4 years ago

The MySQL function LAST_INSERT_ID() should be supported to facilitate inserts.

sql.$select({ last_id: { $lastInsertedId: true } });

should produce

SELECT LAST_INSERT_ID() AS last_id
planetarydev commented 4 years ago

See #35. Every PR is welcome.