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
Sql typing no longer works with interface types #410
Comments
This feature was removed in v31. I think v30.4.2 was an accidental release. Can you give 30.4.3 a try? |
Unfortunately, the same error with v30.4.3. |
Released v30.4.4 to npm |
@gajus This is still an issue, it's impossilbe to work with interfaces and |
Assuming this worked before, downgrading further will eventually find a version that works. It should be v30.4.4 though. However, given that these are no longer supported, their use is highly discouraged. |
@gajus what isn't supported? interfaces? |
Interface support has been removed. All static types are getting removed in favor of Zod in future versions. |
That's BIG... maybe too big |
See long discussion in this thread and this article https://contra.com/p/gkOQlbLq-validating-postgre-sql-query-results-using-runtime-checks |
@gajus I'm a bit surprised #364 is the reference point for how this dramatic decision was made. That thread, in my opinion, establishes that it would have been unnecessary to remove plain interface support for the zod feature. Then interface support was just removed as a follow up, without any external review or further opportunity for comment by me or others who have contributed to slonik over the years, as far as I could tell. @gilamran I am on the lookout for a more suitable library for my team and will likely not maintain Edit: edited for tone. I'm sorry if that came off unpleasant, I'm very grateful for this library which has been working well in production for us for years. I'd still love to keep working with it, but what we need is a sql client for typescript and slonik is now a sql-zod-client. I did get a bit frustrated at the idea that I was part of that decision, rather than someone who actively resisted it as not necessary, so I'm sorry if I came off ungrateful or rude. 🙏 |
@mmkal I totally with you on this. Removing support for interfaces on some minor version is not acceptable in my opinion. p.s. I don't see your comment as rude. Any contributor's opinion should be heard. This is open source. @mmkal what's your discord name and 4 digits? |
Trying to use an interface type with an SQL query, for example:
Expected Behavior
The code above should compile correctly.
Current Behavior
TypeScript compiler gives the following error:
The code works if the interface is replaced with a type alias.
Possible Solution
The code was working before release 30.4.2. The problem has been probably caused due to adoption of MixedRow
The text was updated successfully, but these errors were encountered: