kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
9.9k stars 249 forks source link

chore: warn instead of throwing error if transform returns different nodes #926

Closed austinwoon closed 3 months ago

austinwoon commented 3 months ago

allows us to return a different node.

Specific use case here https://discord.com/channels/890118421587578920/1223240368703799418/1223240368703799418 where I want to be able to safely detect empty array inserts and transform them into no ops with a plugin.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 29, 2024 7:07pm
koskimas commented 3 months ago

This isn't a good idea. The warning still suggests this is something you shouldn't do or things break. The result is the same. People won't do it.

Either remove the restriction alltogether or keep as-is.

austinwoon commented 3 months ago

This isn't a good idea. The warning still suggests this is something you shouldn't do or things break. The result is the same. People won't do it.

Either remove the restriction alltogether or keep as-is.

Ok, which would you suggest? Will leave it to you since I understand there are some principles for the library.