dart-neats
dart-neats copied to clipboard
[typed_sql] JSONB/JSON support
- [x] https://github.com/google/dart-neats/pull/291
- [x] Support for
@DefaultValue(JsonValue{'foo': 42, 'bar': null}))on fields withJsonValue. - [x] Tests for
.distinct()withJsonValue. - [x] Expressions and tests for
JsonValue- [x]
.orElseand.orElseValue - [x]
.isNull,.isNotNull.- We need careful documentation that explains the different between
NULLin SQL andnulland JSON, at-least for operators that can work onExpr<JsonValue?>. - Including tests in
test/typed_sql/expr/.
- We need careful documentation that explains the different between
- [x] JSON specific operators, like
.containsKey,.getKey(),.length`, etc.
- [x]
- [x] Forbid use of
JsonValuein:- [x]
@PrimaryKey, - [x]
@ForeignKeyand@References - [x]
@Uniqueconstraints.
- [x]
- [x] Test use of
JsonValuein.groupBy - [x] Test
JsonValue?as field, seetest/typed_sql/nullable/ - [x] Add support and tests for
final class MyDataType implements CustomDataType<JsonValue>- [ ] Forbid implementation of
CustomDataType<JsonValue>andComparable<T>.
- [ ] Forbid implementation of
- [x] Update documentation guides to mention
JsonValue. - [ ] Add dedicated documentation page with detailed example for
JsonValue.- How to use
JsonValue- Define a JSON field in a schema.
- Declaring a default value.
- Caveats when using distinct/group_by with
JsonValue(possible difference between databases). - Using operators, and caveats around SQL
NULLand JSONnull. (Strongly recommend not using JSONnull, if feasible). - Operators on
Expr<JsonValue>, how to use, and caveats.
- How to subclass using
CustomDataType<JsonValue> - How to add custom operators on
Expr<CustomDataType<JsonValue>>using JSON operators.
- How to use
@isoos