Commit b2526ec
Add Action<T> Set overload for assignment syntax (#33)
* Add Action<T> Set overload for assignment syntax (#32)
Add Set(Action<T>) overload to IUpdateBuilder<T> and IExecutableUpdateBuilder<T>
supporting both single-assignment expression lambdas and multi-assignment
statement lambdas. The source generator extracts property assignments from
the lambda body at compile time, producing carrier-optimized interceptors
with zero delegate allocation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove accidentally committed conversation log file
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix review items: captured variable safety, style, and test coverage
- Fix redundant LiteralExpressionSyntax check in IsCapturedVariable
- Restrict captured variable extraction to simple IdentifierNameSyntax
(complex expressions like obj.Value or GetName() are inlined instead
of attempting broken GetField lookup)
- Remove ReSharper suppress from IModificationBuilder.cs
- Remove global:: prefix from Action<T> in generated code to match
Expression<Func<>> convention
- Add captured variable test (single and multi-assignment)
- Add type-mapped column test (Money/Balance)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add SQLite integration tests for all Update Set forms
- Add UpdateIntegrationTests with 10 end-to-end tests covering:
Set<TValue>(Expression, TValue), Set(T entity), Set(Action<T>)
single/multi-assignment, captured variables, chained forms, and All()
- Fix carrier terminal logging for non-nullable value types: use
.ToString() directly instead of ?.ToString() which fails on bool/int
- Fix pre-existing CS8604 warnings in carrier logging for nullable
reference type fields (string?) by using ?.ToString() ?? "null"
- Extract CarrierClassBuilder.IsNonNullableValueType() for shared use
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix captured variable carrier optimization, add conditional chain tests, update README
- Fix Set(Action<T>) captured variables not carrier-optimized: skip
UpdateSetAction clauses from the direct-path check in BuildPrebuiltChainInfo,
since they use delegate.Target + FieldInfo extraction, not expression tree paths.
- Add per-interceptor carrier-optimized label in XML remarks.
- Add ConditionalCarrierTests (19 tests): validates carrier class + bitmask
dispatch code generation for Select, Update, and Delete conditional chains.
- Add ConditionalChainSqlTests (18 tests): validates runtime ToDiagnostics()
SQL output for conditional chains across all operation types.
- Add carrier generation tests for Set(Action<T>) literal and captured variable.
- Update README: db.Users property -> db.Users() method, QueryBuilder<T> ->
IEntityAccessor<T>, add Set(Action<T>) docs, add ToDiagnostics(), remove
Set Operations (API removed in #27).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix boolean literal formatting for non-PostgreSQL dialects in Set(Action<T>)
During discovery, inlined boolean constants were formatted using the
default PostgreSQL dialect (TRUE/FALSE). Non-PostgreSQL dialects (SQLite,
MySQL, SQL Server) require 0/1 instead. Added ReformatInlinedBooleanForDialect
to re-format boolean tokens during enrichment when the correct dialect is known.
Closes #46
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Inline compile-time constants in Set(Action<T>) SQL, update README
Add constant detection to TranslateSetAction: values that are compile-time
constants (literals, const fields) are inlined directly into the SQL string
instead of bound as parameters. For example, Set(u => u.IsActive = false)
now produces SET "IsActive" = 0 instead of SET "IsActive" = @p0.
- ClauseInfo.cs: Add InlinedSqlValue, InlinedCSharpExpression, IsInlined
to SetActionAssignment for carrying inlined constant data.
- ClauseTranslator.cs: Check GetConstantValue() before creating parameters;
use FormatConstantAsSqlLiteral for inlineable values.
- ExpressionSyntaxTranslator.cs: Make FormatConstantAsSqlLiteral internal.
- CompileTimeSqlBuilder.cs: Emit InlinedSqlValue for inlined assignments,
track parameter offsets separately from assignment count.
- InterceptorCodeGenerator.Modifications.cs: Handle inlined assignments in
standalone path using InlinedCSharpExpression.
- CrossDialectUpdateTests.cs: Update expected SQL to reflect inlined constants.
- README.md: Add ToDiagnostics() usage section, expand Set(Action<T>) docs
with captured variable example.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8f82f90 commit b2526ec
25 files changed
Lines changed: 2482 additions & 1857 deletions
File tree
- src
- Quarry.Generator
- Generation
- Models
- Parsing
- Sql
- Translation
- Quarry.Tests
- Generation
- Integration
- SqlOutput
- Quarry
- Internal
- Query/Modification
Lines changed: 0 additions & 1808 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
| 224 | + | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
| 263 | + | |
| 264 | + | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | | - | |
| 276 | + | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
314 | 308 | | |
315 | 309 | | |
316 | 310 | | |
| |||
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
324 | | - | |
325 | | - | |
326 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
327 | 321 | | |
328 | 322 | | |
329 | 323 | | |
330 | 324 | | |
| 325 | + | |
| 326 | + | |
331 | 327 | | |
332 | | - | |
333 | | - | |
334 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
335 | 357 | | |
336 | 358 | | |
337 | 359 | | |
338 | 360 | | |
339 | 361 | | |
340 | 362 | | |
341 | | - | |
| 363 | + | |
342 | 364 | | |
343 | 365 | | |
344 | 366 | | |
| |||
352 | 374 | | |
353 | 375 | | |
354 | 376 | | |
| 377 | + | |
355 | 378 | | |
356 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
357 | 405 | | |
358 | 406 | | |
359 | 407 | | |
| |||
446 | 494 | | |
447 | 495 | | |
448 | 496 | | |
449 | | - | |
| 497 | + | |
450 | 498 | | |
451 | 499 | | |
452 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
141 | 157 | | |
142 | 158 | | |
143 | 159 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
819 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
820 | 821 | | |
821 | 822 | | |
| 823 | + | |
| 824 | + | |
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
| |||
0 commit comments