@zio.dev/zio-blocks 0.0.55 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/guides/async-getting-started.md +1 -1
- package/guides/query-dsl-extending.md +1 -1
- package/guides/query-dsl-fluent-builder.md +1 -1
- package/guides/query-dsl-reified-optics.md +1 -1
- package/guides/query-dsl-sql.md +1 -1
- package/guides/telemetry-guide.md +3 -3
- package/guides/zio-schema-migration.md +6 -6
- package/index.md +58 -34
- package/package.json +1 -1
- package/reference/async.md +2 -2
- package/reference/chunk.md +3 -3
- package/reference/codegen/index.md +1 -1
- package/reference/combinators.md +4 -4
- package/reference/config/config-source.md +2 -2
- package/reference/config/formats.md +3 -3
- package/reference/config/index.md +7 -7
- package/reference/config/rollout.md +1 -1
- package/reference/context.md +1 -1
- package/reference/data-migration.md +1 -1
- package/reference/datastar/index.md +2 -2
- package/reference/datastar.md +2 -2
- package/reference/docs.md +2 -2
- package/reference/endpoint/endpoint.md +1 -0
- package/reference/endpoint/index.md +4 -4
- package/reference/html.md +2 -2
- package/reference/htmx/index.md +2 -2
- package/reference/http-model/model.md +2 -2
- package/reference/http-model/schema-codecs.md +1 -1
- package/reference/http-model/schema.md +2 -2
- package/reference/jwt.md +1 -1
- package/reference/maybe.md +2 -2
- package/reference/media-type.md +2 -2
- package/reference/mux.mdx +2 -2
- package/reference/openapi.md +3 -3
- package/reference/projection.md +3 -3
- package/reference/resource-management/index.md +1 -1
- package/reference/resource-management/resource.md +2 -2
- package/reference/resource-management/scope.md +1 -1
- package/reference/resource-management/wire.md +2 -2
- package/reference/ringbuffer/index.mdx +2 -2
- package/reference/schema/built-in-codecs/avro.md +2 -2
- package/reference/schema/built-in-codecs/bson.md +9 -9
- package/reference/schema/built-in-codecs/csv.md +2 -2
- package/reference/schema/built-in-codecs/json/index.md +2 -2
- package/reference/schema/built-in-codecs/json/json.md +1 -0
- package/reference/schema/built-in-codecs/messagepack.md +3 -3
- package/reference/schema/built-in-codecs/thrift.md +2 -2
- package/reference/schema/built-in-codecs/toon.md +3 -3
- package/reference/schema/built-in-codecs/yaml.md +2 -2
- package/reference/schema/codec.md +10 -10
- package/reference/schema/dynamic-schema.md +3 -3
- package/reference/schema/schema-evolution/as.md +4 -4
- package/reference/schema/schema-evolution/into.md +2 -2
- package/reference/schema/schema-expr.md +2 -2
- package/reference/schema/type-class-derivation.md +1 -1
- package/reference/smithy.md +1 -1
- package/reference/sql/db-codec-deriver.md +3 -3
- package/reference/sql/db-codec.md +11 -11
- package/reference/sql/db-con.md +4 -4
- package/reference/sql/db-connection.md +1 -1
- package/reference/sql/db-tx.md +2 -2
- package/reference/sql/ddl.md +1 -1
- package/reference/sql/index.md +6 -6
- package/reference/sql/repo.md +5 -5
- package/reference/sql/sql-dialect.md +1 -1
- package/reference/sql/sql-logger.md +1 -1
- package/reference/sql/sql-name-mapper.md +3 -3
- package/reference/sql/table-metadata.md +3 -3
- package/reference/sql/table.md +10 -10
- package/reference/sql/transactor-zio.md +1 -1
- package/reference/sql/transactor.md +8 -8
- package/reference/sql-zio.md +2 -2
- package/reference/streams/core/pipeline.md +17 -17
- package/reference/streams/core/sink.md +4 -4
- package/reference/streams/core/stream.md +3 -3
- package/reference/streams/execution-and-compatibility/async-execution.md +1 -1
- package/reference/streams/index.md +3 -3
- package/reference/streams/primitives/reader.md +25 -25
- package/reference/streams/primitives/writer.md +18 -18
- package/reference/telemetry/index.md +3 -3
- package/reference/telemetry/otel/index.md +1 -1
- package/sidebars.js +261 -219
- package/reference/mux.md +0 -254
|
@@ -70,13 +70,13 @@ This separation is powerful: you can build, manipulate, serialize, and test HTTP
|
|
|
70
70
|
Add the following to your `build.sbt`:
|
|
71
71
|
|
|
72
72
|
```scala
|
|
73
|
-
libraryDependencies += "dev.zio" %% "zio-http-model" % "0.0.
|
|
73
|
+
libraryDependencies += "dev.zio" %% "zio-http-model" % "0.0.56"
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
For cross-platform projects (Scala.js):
|
|
77
77
|
|
|
78
78
|
```scala
|
|
79
|
-
libraryDependencies += "dev.zio" %%% "zio-http-model" % "0.0.
|
|
79
|
+
libraryDependencies += "dev.zio" %%% "zio-http-model" % "0.0.56"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Supported Scala versions: Scala 2.13 and Scala 3.x. The artifacts are cross-platform for JVM and Scala.js.
|
|
@@ -397,7 +397,7 @@ listCodec.encodeToQueryParams(List(1, 2))
|
|
|
397
397
|
|
|
398
398
|
```scala
|
|
399
399
|
val headerIntCodec = Schema[Int].derive(DefaultHeaderFormat)
|
|
400
|
-
// headerIntCodec: HeaderCodec[Int] = zio.http.schema.HeaderCodecDeriver$$anon$3@
|
|
400
|
+
// headerIntCodec: HeaderCodec[Int] = zio.http.schema.HeaderCodecDeriver$$anon$3@33407159
|
|
401
401
|
headerIntCodec.encodeToHeaders(42).toList
|
|
402
402
|
// res25: List[Tuple2[String, String]] = List(("value", "42"))
|
|
403
403
|
headerIntCodec.decode(Headers("value" -> "42"))
|
|
@@ -54,13 +54,13 @@ This keeps HTTP request handling clean, testable, and portable across different
|
|
|
54
54
|
Add the following to your `build.sbt`:
|
|
55
55
|
|
|
56
56
|
```
|
|
57
|
-
libraryDependencies += "dev.zio" %% "zio-http-model-schema" % "0.0.
|
|
57
|
+
libraryDependencies += "dev.zio" %% "zio-http-model-schema" % "0.0.56"
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
For cross-platform projects (Scala.js):
|
|
61
61
|
|
|
62
62
|
```
|
|
63
|
-
libraryDependencies += "dev.zio" %%% "zio-http-model-schema" % "0.0.
|
|
63
|
+
libraryDependencies += "dev.zio" %%% "zio-http-model-schema" % "0.0.56"
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Supported Scala versions: Scala 3.x only. Requires `zio-http-model` and `zio-blocks-schema` as dependencies.
|
package/reference/jwt.md
CHANGED
|
@@ -142,7 +142,7 @@ Jwt.sign(claims, key, Algorithm.HS256, hdr)
|
|
|
142
142
|
| ES512 | ✓ | ✓ | — | P-521 (`secp521r1`, 66-byte components) |
|
|
143
143
|
| EdDSA | ✓ | — | — | Ed25519 |
|
|
144
144
|
|
|
145
|
-
Keys shorter than the HWA minima are rejected with `InvalidKey` (not `UnsupportedAlgorithm` or `InvalidToken`). RSA
|
|
145
|
+
Keys shorter than the HWA minima are rejected with `InvalidKey` (not `UnsupportedAlgorithm` or `InvalidToken`). RSA <2048 bits and EC curve mismatches (e.g. `ES256` with `secp384r1`) are also rejected with `InvalidKey`.
|
|
146
146
|
|
|
147
147
|
Query what a backend supports at runtime:
|
|
148
148
|
|
package/reference/maybe.md
CHANGED
|
@@ -138,13 +138,13 @@ So on Scala 2.13 the sealed `MaybeValue` form is the compiler-checked native idi
|
|
|
138
138
|
Add the `zio-blocks-maybe` module to your build:
|
|
139
139
|
|
|
140
140
|
```scala
|
|
141
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-maybe" % "0.0.
|
|
141
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-maybe" % "0.0.56"
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
For Scala.js:
|
|
145
145
|
|
|
146
146
|
```scala
|
|
147
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-maybe" % "0.0.
|
|
147
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-maybe" % "0.0.56"
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
Supported Scala versions: 2.13.x and 3.x
|
package/reference/media-type.md
CHANGED
|
@@ -75,13 +75,13 @@ textAny.matches(html) // true
|
|
|
75
75
|
Add the following to your `build.sbt`:
|
|
76
76
|
|
|
77
77
|
```scala
|
|
78
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-mediatype" % "0.0.
|
|
78
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-mediatype" % "0.0.56"
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
For cross-platform projects (Scala.js):
|
|
82
82
|
|
|
83
83
|
```scala
|
|
84
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-mediatype" % "0.0.
|
|
84
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-mediatype" % "0.0.56"
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
Supported Scala versions: 2.13.x and 3.x.
|
package/reference/mux.mdx
CHANGED
|
@@ -47,13 +47,13 @@ Without multiplexing, protocols must open a new connection per concurrent operat
|
|
|
47
47
|
Add the dependency to your build:
|
|
48
48
|
|
|
49
49
|
```scala
|
|
50
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-mux" % "0.0.
|
|
50
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-mux" % "0.0.56"
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
For Scala.js:
|
|
54
54
|
|
|
55
55
|
```scala
|
|
56
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-mux" % "0.0.
|
|
56
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-mux" % "0.0.56"
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Supported Scala versions: 2.13.x and 3.x
|
package/reference/openapi.md
CHANGED
|
@@ -27,16 +27,16 @@ The OpenAPI module bridges the gap by letting you author API specs as Scala code
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
29
29
|
```scala
|
|
30
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-openapi" % "0.0.
|
|
30
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-openapi" % "0.0.56"
|
|
31
31
|
|
|
32
32
|
// You'll also need the schema module for Schema[A] integration:
|
|
33
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
33
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
For Scala.js:
|
|
37
37
|
|
|
38
38
|
```scala
|
|
39
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-openapi" % "0.0.
|
|
39
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-openapi" % "0.0.56"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Supported Scala versions: 2.13.x and 3.x.
|
package/reference/projection.md
CHANGED
|
@@ -11,13 +11,13 @@ entities.
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```scala
|
|
14
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-projection" % "0.0.
|
|
14
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-projection" % "0.0.56"
|
|
15
15
|
|
|
16
16
|
// JVM only — SQLite-backed stores
|
|
17
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-projection" % "0.0.
|
|
17
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-projection" % "0.0.56"
|
|
18
18
|
|
|
19
19
|
// ZIO integration (transactor cache, engine runtime)
|
|
20
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-sql-zio" % "0.0.
|
|
20
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-sql-zio" % "0.0.56"
|
|
21
21
|
|
|
22
22
|
// for SQLite persistence add: libraryDependencies += "org.xerial" % "sqlite-jdbc" % "3.53.4.0" // or InMemory fallback if not present
|
|
23
23
|
libraryDependencies += "org.xerial" % "sqlite-jdbc" % "3.53.4.0"
|
|
@@ -36,13 +36,13 @@ Without Resources, managing complex initialization and cleanup is tedious and er
|
|
|
36
36
|
Add the ZIO Blocks Scope module to your `build.sbt`:
|
|
37
37
|
|
|
38
38
|
```scala
|
|
39
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.
|
|
39
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.56"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
For cross-platform (Scala.js):
|
|
43
43
|
|
|
44
44
|
```scala
|
|
45
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.
|
|
45
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.56"
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Supported Scala versions: 2.13.x and 3.x.
|
|
@@ -55,7 +55,7 @@ If you've used `try/finally`, `Using`, or ZIO's `Scope`, this is the same proble
|
|
|
55
55
|
Add the following dependency to your `build.sbt`:
|
|
56
56
|
|
|
57
57
|
```scala
|
|
58
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.
|
|
58
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.56"
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Supported Scala versions: **2.13.x** and **3.x**.
|
|
@@ -92,13 +92,13 @@ Scope.global.scoped { scope =>
|
|
|
92
92
|
Add the following dependency to your `build.sbt`:
|
|
93
93
|
|
|
94
94
|
```scala
|
|
95
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.
|
|
95
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.56"
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
For cross-platform (Scala.js):
|
|
99
99
|
|
|
100
100
|
```scala
|
|
101
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.
|
|
101
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.56"
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Supported Scala versions: 2.13.x and 3.x.
|
|
@@ -124,13 +124,13 @@ RingBuffer is ideal when you control both producer and consumer thread counts an
|
|
|
124
124
|
Add the ZIO Blocks Ring Buffer module to your `build.sbt`:
|
|
125
125
|
|
|
126
126
|
```scala
|
|
127
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.
|
|
127
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.56"
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
For Scala.js cross-platform support:
|
|
131
131
|
|
|
132
132
|
```scala
|
|
133
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-ringbuffer" % "0.0.
|
|
133
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-ringbuffer" % "0.0.56"
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
## Implementations
|
|
@@ -26,7 +26,7 @@ Rather than writing custom encoders or relying on string-based Avro schema confi
|
|
|
26
26
|
Add the module to your `build.sbt` (JVM-only, not available for Scala.js):
|
|
27
27
|
|
|
28
28
|
```sbt
|
|
29
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.
|
|
29
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.56"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -341,7 +341,7 @@ object Person {
|
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
val codec = Person.schema.derive(AvroFormat)
|
|
344
|
-
// codec: AvroCodec[Person] = zio.blocks.schema.avro.AvroCodecDeriver$$anon$4@
|
|
344
|
+
// codec: AvroCodec[Person] = zio.blocks.schema.avro.AvroCodecDeriver$$anon$4@7767df5c
|
|
345
345
|
```
|
|
346
346
|
|
|
347
347
|
### Primitive Type Support
|
|
@@ -27,7 +27,7 @@ Rather than writing custom encoders or relying on string-based configuration, yo
|
|
|
27
27
|
Add the module to your `build.sbt`:
|
|
28
28
|
|
|
29
29
|
```sbt
|
|
30
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.
|
|
30
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.56"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**Note:** This module is JVM-only and is not available for Scala.js.
|
|
@@ -396,25 +396,25 @@ object Person {
|
|
|
396
396
|
|
|
397
397
|
val codec = Person.schema.derive(BsonCodecDeriver)
|
|
398
398
|
// codec: BsonCodec[Person] = BsonCodec(
|
|
399
|
-
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@
|
|
400
|
-
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@
|
|
399
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@484f978e,
|
|
400
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@2785badf
|
|
401
401
|
// )
|
|
402
402
|
val configuredCodec = Person.schema.derive(BsonCodecDeriver.withIgnoreExtraFields(false))
|
|
403
403
|
// configuredCodec: BsonCodec[Person] = BsonCodec(
|
|
404
|
-
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@
|
|
405
|
-
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@
|
|
404
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@454102ab,
|
|
405
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@71861e6a
|
|
406
406
|
// )
|
|
407
407
|
|
|
408
408
|
// Compatibility facade
|
|
409
409
|
val compatibleCodec = BsonSchemaCodec.bsonCodec(Person.schema)
|
|
410
410
|
// compatibleCodec: BsonCodec[Person] = BsonCodec(
|
|
411
|
-
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@
|
|
412
|
-
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@
|
|
411
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@6580f105,
|
|
412
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@2899e344
|
|
413
413
|
// )
|
|
414
414
|
val configuredCompatibleCodec = BsonSchemaCodec.bsonCodec(Person.schema, BsonSchemaCodec.Config)
|
|
415
415
|
// configuredCompatibleCodec: BsonCodec[Person] = BsonCodec(
|
|
416
|
-
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@
|
|
417
|
-
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@
|
|
416
|
+
// encoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$5@6affb8b8,
|
|
417
|
+
// decoder = zio.blocks.schema.bson.BsonCodecDeriver$$anon$6@815743b
|
|
418
418
|
// )
|
|
419
419
|
```
|
|
420
420
|
|
|
@@ -37,13 +37,13 @@ Rather than writing custom parsers or relying on string-based configuration, you
|
|
|
37
37
|
Add the module to your `build.sbt`:
|
|
38
38
|
|
|
39
39
|
```sbt
|
|
40
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.
|
|
40
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.56"
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
For Scala.js, use `%%%` instead of `%%`:
|
|
44
44
|
|
|
45
45
|
```sbt
|
|
46
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-csv" % "0.0.
|
|
46
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-csv" % "0.0.56"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -36,13 +36,13 @@ schema.conforms(person) // true
|
|
|
36
36
|
The JSON codec is included in the ZIO Blocks Schema module. Add it to your `build.sbt`:
|
|
37
37
|
|
|
38
38
|
```scala
|
|
39
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
39
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
For Scala.js projects, use `%%%` instead:
|
|
43
43
|
|
|
44
44
|
```scala
|
|
45
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.
|
|
45
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.56"
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
**Supported Scala versions:** 2.13.x and 3.x
|
|
@@ -27,13 +27,13 @@ Rather than writing custom encoders or relying on string-based schema configurat
|
|
|
27
27
|
Add the module to your `build.sbt`:
|
|
28
28
|
|
|
29
29
|
```sbt
|
|
30
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.
|
|
30
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.56"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
For Scala.js, use `%%%` instead of `%%`:
|
|
34
34
|
|
|
35
35
|
```sbt
|
|
36
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-messagepack" % "0.0.
|
|
36
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-messagepack" % "0.0.56"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -338,7 +338,7 @@ object Person {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
val codec = Person.schema.derive(MessagePackFormat)
|
|
341
|
-
// codec: MessagePackCodec[Person] = zio.blocks.schema.msgpack.MessagePackCodecDeriver$$anon$3@
|
|
341
|
+
// codec: MessagePackCodec[Person] = zio.blocks.schema.msgpack.MessagePackCodecDeriver$$anon$3@612ff3c4
|
|
342
342
|
```
|
|
343
343
|
|
|
344
344
|
### Primitive Type Support
|
|
@@ -26,7 +26,7 @@ Rather than writing custom encoders or relying on code generation from .thrift f
|
|
|
26
26
|
Add the module to your `build.sbt`:
|
|
27
27
|
|
|
28
28
|
```sbt
|
|
29
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.
|
|
29
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.56"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
**Note:** This module is JVM-only and is not available for Scala.js.
|
|
@@ -323,7 +323,7 @@ object Person {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
val codec = Person.schema.derive(ThriftFormat)
|
|
326
|
-
// codec: ThriftCodec[Person] = zio.blocks.schema.thrift.ThriftCodecDeriver$$anon$3@
|
|
326
|
+
// codec: ThriftCodec[Person] = zio.blocks.schema.thrift.ThriftCodecDeriver$$anon$3@65cebe3a
|
|
327
327
|
```
|
|
328
328
|
|
|
329
329
|
### Primitive Type Support
|
|
@@ -28,13 +28,13 @@ Rather than hand-writing TOON parsing logic or relying on external libraries wit
|
|
|
28
28
|
Add the module to your `build.sbt`:
|
|
29
29
|
|
|
30
30
|
```sbt
|
|
31
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.
|
|
31
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.56"
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
For Scala.js, use `%%%` instead of `%%`:
|
|
35
35
|
|
|
36
36
|
```sbt
|
|
37
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-toon" % "0.0.
|
|
37
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-toon" % "0.0.56"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -325,7 +325,7 @@ object Person {
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
val codec = Person.schema.derive(ToonFormat)
|
|
328
|
-
// codec: ToonCodec[Person] = zio.blocks.schema.toon.ToonCodecDeriver$$anon$5@
|
|
328
|
+
// codec: ToonCodec[Person] = zio.blocks.schema.toon.ToonCodecDeriver$$anon$5@346da013
|
|
329
329
|
val person = Person("Alice", "alice@example.com")
|
|
330
330
|
// person: Person = Person(name = "Alice", email = "alice@example.com")
|
|
331
331
|
val bytes = codec.encode(person)
|
|
@@ -27,13 +27,13 @@ Rather than hand-writing YAML parsing logic or relying on external libraries wit
|
|
|
27
27
|
Add the module to your `build.sbt`:
|
|
28
28
|
|
|
29
29
|
```sbt
|
|
30
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-yaml" % "0.0.
|
|
30
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-yaml" % "0.0.56"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
For Scala.js, use `%%%` instead of `%%`:
|
|
34
34
|
|
|
35
35
|
```sbt
|
|
36
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-yaml" % "0.0.
|
|
36
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema-yaml" % "0.0.56"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -48,26 +48,26 @@ val result: Either[SchemaError, Person] = Person.codec.decode(bytes)
|
|
|
48
48
|
To include the base schema module with JSON support, add the following dependency to your `build.sbt`:
|
|
49
49
|
|
|
50
50
|
```scala
|
|
51
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
51
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Additional format modules are separate artifacts:
|
|
55
55
|
|
|
56
56
|
```scala
|
|
57
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.
|
|
58
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.
|
|
59
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.
|
|
60
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.
|
|
61
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.
|
|
62
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.
|
|
63
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-xml" % "0.0.
|
|
64
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema-yaml" % "0.0.
|
|
57
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.56"
|
|
58
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.56"
|
|
59
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.56"
|
|
60
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.56"
|
|
61
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.56"
|
|
62
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.56"
|
|
63
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-xml" % "0.0.56"
|
|
64
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema-yaml" % "0.0.56"
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
For cross-platform projects (Scala.js):
|
|
68
68
|
|
|
69
69
|
```scala
|
|
70
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.
|
|
70
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.56"
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Supported Scala versions: 2.13.x and 3.x.
|
|
@@ -83,7 +83,7 @@ dynamic
|
|
|
83
83
|
// value = Primitive(
|
|
84
84
|
// primitiveType = String(None),
|
|
85
85
|
// typeId = String,
|
|
86
|
-
// primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@
|
|
86
|
+
// primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@b3c65fe,
|
|
87
87
|
// doc = Doc(blocks = IndexedSeq(), metadata = Map()),
|
|
88
88
|
// modifiers = List(),
|
|
89
89
|
// storedDefaultValue = None,
|
|
@@ -97,7 +97,7 @@ dynamic
|
|
|
97
97
|
// value = Primitive(
|
|
98
98
|
// primitiveType = Int(None),
|
|
99
99
|
// typeId = Int,
|
|
100
|
-
// primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@
|
|
100
|
+
// primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@b3c65fe,
|
|
101
101
|
// doc = Doc(blocks = IndexedSeq(), metadata = Map()),
|
|
102
102
|
// modifiers = List(),
|
|
103
103
|
// storedDefaultValue = None,
|
|
@@ -115,7 +115,7 @@ dynamic
|
|
|
115
115
|
// value = Primitive(
|
|
116
116
|
// primitiveType = String(None),
|
|
117
117
|
// typeId = String,
|
|
118
|
-
// primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@
|
|
118
|
+
// primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@b3c65fe,
|
|
119
119
|
// doc = Doc(blocks = IndexedSeq(), metadata = Map()),
|
|
120
120
|
// modifiers = List(),
|
|
121
121
|
// storedDefaultValue = None,
|
|
@@ -39,13 +39,13 @@ The bidirectional data flow looks like this:
|
|
|
39
39
|
`As` is part of `zio-blocks-schema`:
|
|
40
40
|
|
|
41
41
|
```scala
|
|
42
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
42
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
For Scala.js and Scala Native, use `%%%`:
|
|
46
46
|
|
|
47
47
|
```scala
|
|
48
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.
|
|
48
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.56"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Supported Scala versions: 2.13.x and 3.x.
|
|
@@ -240,7 +240,7 @@ trait As[A, B] {
|
|
|
240
240
|
|
|
241
241
|
```scala
|
|
242
242
|
val revAs: As[LongBox, IntBox] = boxAs.reverse
|
|
243
|
-
// revAs: As[LongBox, IntBox] = zio.blocks.schema.As$$anon$1@
|
|
243
|
+
// revAs: As[LongBox, IntBox] = zio.blocks.schema.As$$anon$1@6ba3739b
|
|
244
244
|
|
|
245
245
|
revAs.into(LongBox(5L))
|
|
246
246
|
// res11: Either[SchemaError, IntBox] = Right(IntBox(5))
|
|
@@ -302,7 +302,7 @@ We import `As.reverseInto` and use it to obtain the reverse `Into[Int, String]`:
|
|
|
302
302
|
import As.reverseInto
|
|
303
303
|
|
|
304
304
|
val intToStr: Into[Int, String] = reverseInto[String, Int]
|
|
305
|
-
// intToStr: Into[Int, String] = zio.blocks.schema.AsLowPriorityImplicits$$Lambda/
|
|
305
|
+
// intToStr: Into[Int, String] = zio.blocks.schema.AsLowPriorityImplicits$$Lambda/0x000000003aef9a10@fef590
|
|
306
306
|
intToStr.into(42)
|
|
307
307
|
// res14: Either[SchemaError, String] = Right("42")
|
|
308
308
|
```
|
|
@@ -69,13 +69,13 @@ Compare this to a manual implementation:
|
|
|
69
69
|
`Into` is part of the `zio-blocks-schema` module:
|
|
70
70
|
|
|
71
71
|
```scala
|
|
72
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
72
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
For Scala.js:
|
|
76
76
|
|
|
77
77
|
```scala
|
|
78
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.
|
|
78
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.56"
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
Supported Scala versions: 2.13.x and 3.x.
|
|
@@ -76,13 +76,13 @@ val result: Either[OpticCheck, Seq[Boolean]] = combined.eval(alice)
|
|
|
76
76
|
## Installation
|
|
77
77
|
|
|
78
78
|
```scala
|
|
79
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.
|
|
79
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.56"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
For cross-platform (Scala.js):
|
|
83
83
|
|
|
84
84
|
```scala
|
|
85
|
-
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.
|
|
85
|
+
libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.56"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
Supported Scala versions: 2.13.x and 3.x.
|
|
@@ -1517,7 +1517,7 @@ Now we can use the derived `Gen[Person]` instance to generate random `Person` va
|
|
|
1517
1517
|
|
|
1518
1518
|
```scala
|
|
1519
1519
|
val random = new Random(42) // Seeded for reproducible output
|
|
1520
|
-
// random: Random = scala.util.Random@
|
|
1520
|
+
// random: Random = scala.util.Random@362685dd
|
|
1521
1521
|
|
|
1522
1522
|
Person.gen.generate(random)
|
|
1523
1523
|
// res14: Person = Person(name = "p", age = -1360544799)
|
package/reference/smithy.md
CHANGED
|
@@ -10,7 +10,7 @@ title: "Smithy"
|
|
|
10
10
|
Add the library to your build configuration:
|
|
11
11
|
|
|
12
12
|
```scala
|
|
13
|
-
libraryDependencies += "dev.zio" %% "zio-blocks-smithy" % "0.0.
|
|
13
|
+
libraryDependencies += "dev.zio" %% "zio-blocks-smithy" % "0.0.56"
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Supported Scala versions: 2.13.x and 3.x
|
|
@@ -50,7 +50,7 @@ DbCodec[User].columns
|
|
|
50
50
|
case class Event(eventId: Long, eventType: String)
|
|
51
51
|
object Event { implicit val schema: Schema[Event] = Schema.derived }
|
|
52
52
|
val eventCodec = DbCodec.derived[Event]
|
|
53
|
-
// eventCodec: DbCodec[Event] = zio.blocks.sql.DbCodecDeriver$$anon$10@
|
|
53
|
+
// eventCodec: DbCodec[Event] = zio.blocks.sql.DbCodecDeriver$$anon$10@5ff67e34
|
|
54
54
|
eventCodec.columns
|
|
55
55
|
// res1: IndexedSeq[String] = Vector("event_id", "event_type")
|
|
56
56
|
|
|
@@ -59,9 +59,9 @@ case class Widget(widgetId: Int, widgetName: String)
|
|
|
59
59
|
object Widget { implicit val schema: Schema[Widget] = Schema.derived }
|
|
60
60
|
|
|
61
61
|
val identityDeriver = DbCodecDeriver.withColumnNameMapper(SqlNameMapper.Identity)
|
|
62
|
-
// identityDeriver: DbCodecDeriver = zio.blocks.sql.DbCodecDeriver@
|
|
62
|
+
// identityDeriver: DbCodecDeriver = zio.blocks.sql.DbCodecDeriver@502cd2f2
|
|
63
63
|
val widgetCodec = Widget.schema.deriving(identityDeriver).derive
|
|
64
|
-
// widgetCodec: DbCodec[Widget] = zio.blocks.sql.DbCodecDeriver$$anon$10@
|
|
64
|
+
// widgetCodec: DbCodec[Widget] = zio.blocks.sql.DbCodecDeriver$$anon$10@151213be
|
|
65
65
|
widgetCodec.columns
|
|
66
66
|
// res2: IndexedSeq[String] = Vector("widgetId", "widgetName")
|
|
67
67
|
```
|