Releases: mk3008/Carbunql
Releases · mk3008/Carbunql
0.8.14
0.8.13.2
0.8.13.1
0.8.13
What's Changed
- Enhancements for Table Joins, Column/Table Existence Checks, and New Functions by @mk3008 in #542
- Fix: Missing namespace import added to resolve build errors by @mk3008 in #543
- Fix: Adjusted column alias handling in Select method to avoid empty aliases by @mk3008 in #544
- Add: Support for parsing UPDATE queries by @mk3008 in #548
- Add: Support for parsing DELETE queries by @mk3008 in #549
- Support: Leading Comma SQL Formatting by @mk3008 in #550
Full Changelog: 0.8.12...0.8.13
0.8.12
Added If, IfNotNull, and IfNotNullOrEmpty functions.
It's now easier to write dynamic search conditions.
int? price = null;
var query = SelectQuery.Parse(sql)
.If(price != null, x => x.Equal(nameof(price), price));
💣Serialization feature has been removed
We have discontinued it for the time being as the maintenance costs are not justified.
Marked AddParameter as obsolete
We recommend using the parameter method.
Supports ANY function parsing
SELECT
s.unit_price * s.amount AS price
FROM
sale AS s
WHERE
s.unit_price * s.amount = ANY(:prices)
Add support for ESCAPE keyword in LIKE clause parsing
WITH users AS (
SELECT '30' as name
UNION ALL
SELECT '%30'
)
SELECT * FROM users WHERE name LIKE 'x%3%' escape 'x'
Full Changelog
0.8.11
Added the FluentTable class.
This class can manage queries by CTE name and alias name together.
This makes writing query processing much simpler.
Example
[Fact]
public void PhysicalTableTest()
{
var tableA = FluentTable.Create("table_a", "a");
var sq = new SelectQuery()
.From(tableA)
.SelectAll(tableA);
var expect = """
SELECT
a.*
FROM
table_a AS a
""";
Assert.Equal(expect, sq.ToText());
}
[Fact]
public void SubQueryTest()
{
var tableA = FluentTable.Create("select * from table_a", "a");
var sq = new SelectQuery()
.From(tableA)
.SelectAll(tableA);
var expect = """
SELECT
a.*
FROM
(
SELECT
*
FROM
table_a
) AS a
""";
Assert.Equal(expect, sq.ToText());
}
[Fact]
public void CteTest()
{
var tableA = FluentTable.Create("select * from table_a", "cte_a", "a");
var sq = new SelectQuery()
.From(tableA)
.SelectAll(tableA);
var expect = """
WITH
cte_a AS (
SELECT
*
FROM
table_a
)
SELECT
a.*
FROM
cte_a AS a
""";
Assert.Equal(expect, sq.ToText());
}
What's Changed
- Update Carbunql.csproj by @mk3008 in #517
- Update README.md by @mk3008 in #518
- Improved filter search target by @mk3008 in #519
- Enhanced override processing for selected columns by @mk3008 in #521
- Enhancement: Added build method to SelectQuery class. by @mk3008 in #525
- Enhancement: Added ReverseSign function by @mk3008 in #526
- Enhancement: Changed target framework by @mk3008 in #528
- Enhancement: Added FluentTable class by @mk3008 in #529
Full Changelog: 0.8.10...0.8.11