Commit b0830ed
committed
feat: add Set and Map support to ? placeholder expansion
Extend the `?` placeholder handling so that `Set` instances are
expanded like arrays and `Map` instances are expanded like plain
objects.
- `Set` values used inside `IN (?)` or `SELECT ?` are expanded as a
comma-separated list of escaped values, matching existing Array
behavior.
- `Map` values used in `UPDATE ... SET ?` are expanded as
`` `key` = value `` pairs, matching existing Object behavior.
- A `Map` used in a regular `?` position (non-SET) falls back to the
default string coercion (`'[object Map]'`), consistent with how
non-plain objects are handled today.
- Empty `Set` and empty `Map` produce empty expansions, mirroring the
behavior of empty arrays and empty objects.
Tests covering each of these cases are included.1 parent 09e7e65 commit b0830ed
3 files changed
Lines changed: 78 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
352 | | - | |
| 356 | + | |
353 | 357 | | |
354 | 358 | | |
355 | | - | |
356 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
357 | 364 | | |
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
362 | 369 | | |
363 | | - | |
364 | | - | |
| 370 | + | |
365 | 371 | | |
366 | 372 | | |
367 | 373 | | |
| |||
384 | 390 | | |
385 | 391 | | |
386 | 392 | | |
387 | | - | |
388 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
389 | 397 | | |
390 | 398 | | |
391 | 399 | | |
| |||
410 | 418 | | |
411 | 419 | | |
412 | 420 | | |
| 421 | + | |
| 422 | + | |
413 | 423 | | |
414 | 424 | | |
415 | 425 | | |
416 | 426 | | |
417 | 427 | | |
418 | 428 | | |
419 | | - | |
| 429 | + | |
420 | 430 | | |
421 | 431 | | |
422 | 432 | | |
| |||
480 | 490 | | |
481 | 491 | | |
482 | 492 | | |
483 | | - | |
| 493 | + | |
484 | 494 | | |
485 | 495 | | |
486 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
0 commit comments