JasonShin / sqlx-ts

node.js compile-time SQL validations & type generations
https://jasonshin.github.io/sqlx-ts/
MIT License
154 stars 6 forks source link

Support for RETURNING * #117

Closed simplenotezy closed 3 weeks ago

simplenotezy commented 4 weeks ago

It would be nice if the generator supported RETURNING * in queries, like:

https://jasonshin.github.io/sqlx-ts/reference-guide/4.2.INSERT.html

const fetchAnalysisId = await this.db.query({
  text: sql`
  INSERT INTO analysis (type, status) VALUES ($1, $2)
+  RETURNING id
  `,
  values: [AnalysisType.EMAIL, AnalysisStatus.PENDING],
});
JasonShin commented 4 weeks ago

That's a great suggestion

JasonShin commented 3 weeks ago

This PR should handle this https://github.com/JasonShin/sqlx-ts/pull/121

JasonShin commented 3 weeks ago

This is now supported in v0.14.0 👍

simplenotezy commented 3 weeks ago

Wow amazing. That was quick. Will update asap and check it out