4 ms·
Show HN: Parse, Build, Rebuild SQL in C#
In order to increase the reusability of SQL statements, I converted existing SQL statements into objects and made them editable.
- rvdginste 3y agoJust want to add that you can directly manipulate LINQ expressions. It might be more complex, but you can basically transform an IQueryable into another one. And the result can be used everywhere you can use LINQ. You can also take advantage of ExpressionVisitor to manipulate expressions. If you’re in C#, it seems more natural to work with LINQ expressions.
- masugiura 3y agothank you. C# certainly has a powerful syntax called LINQ. If you want to reuse existing SQL, I think you can use this library.
- masugiura 3y agoPlease let me supplement a little. This library is intended for batch processing. "Carbunql" is a bit similar to LINQ in the areas it covers. It is the same as LINQ in that SQL can be written in C#. I don't think there is any advantage to using "Carbunql" for this purpose. However, I thought that it would be useful in the following environments, so I developed it. - Writing SQL directly is more maintainable than using LINQ - You want to reuse that SQL for processing such as obtaining the number of records, adding dynamic search conditions, and creating a temporary table. - The overhead of SQL parsing is acceptable. In other words, the SQL execution frequency is low, and the parse waiting time is extremely small compared to the SQL execution time. the above is very special It may sound like it, but I think it's a common case in batch processing. In other words, I think that it is useful in batch processing.