Commit 3f43346
authored
elixir-client: Build shape definition from changeset (#2801)
Allows for generating a ShapeDefinition from an Ecto.Changeset
Also bundles a few quality-of-life changes:
- ShapeDefinition.params/1 returns a `%{binary => binary}` map in query
string mode, rather than a mix of atom and binary keys
- Widen accepted types for where parameters from `:string` to [:string,
:integer, :float, :boolean]` to make life simpler for user. these types
are trivial to convert to strings so why not do that for people
- Give ShapeDefinitions a `replica` setting. This is how it should have
been to begin with -- the replica mode is a property of the shape, not
of the stream
- Expose the ShapeDefinition validation schema so we can split options
and validate partial shape parameters (Phoenix.Sync.PredefinedShape
accepts a big bag of options that we need to assign appropriately)1 parent a148509 commit 3f43346
12 files changed
Lines changed: 713 additions & 96 deletions
File tree
- .changeset
- packages/elixir-client
- lib/electric
- client
- authenticator
- fetch
- test
- electric
- client
- fetch
- support
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
242 | 251 | | |
243 | 252 | | |
244 | 253 | | |
| |||
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
359 | 375 | | |
360 | 376 | | |
361 | 377 | | |
| |||
364 | 380 | | |
365 | 381 | | |
366 | 382 | | |
367 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
368 | 394 | | |
369 | 395 | | |
370 | 396 | | |
371 | 397 | | |
372 | | - | |
373 | | - | |
| 398 | + | |
| 399 | + | |
374 | 400 | | |
375 | 401 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 402 | + | |
381 | 403 | | |
382 | 404 | | |
383 | 405 | | |
| |||
389 | 411 | | |
390 | 412 | | |
391 | 413 | | |
392 | | - | |
393 | | - | |
394 | 414 | | |
395 | | - | |
| 415 | + | |
396 | 416 | | |
397 | 417 | | |
398 | 418 | | |
| |||
424 | 444 | | |
425 | 445 | | |
426 | 446 | | |
427 | | - | |
| 447 | + | |
428 | 448 | | |
429 | 449 | | |
430 | 450 | | |
| |||
448 | 468 | | |
449 | 469 | | |
450 | 470 | | |
451 | | - | |
| 471 | + | |
452 | 472 | | |
453 | 473 | | |
454 | 474 | | |
| |||
482 | 502 | | |
483 | 503 | | |
484 | 504 | | |
485 | | - | |
| 505 | + | |
486 | 506 | | |
487 | 507 | | |
488 | 508 | | |
489 | 509 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | 510 | | |
496 | 511 | | |
497 | 512 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Lines changed: 80 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
9 | 18 | | |
10 | 19 | | |
11 | | - | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| |||
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
31 | 105 | | |
32 | 106 | | |
33 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
0 commit comments