fix(orm): fix edge case exporting json (#11134)

* fix(orm): fix edge case exporting json

* add import json test
This commit is contained in:
Aaron Craelius
2022-02-07 17:36:12 -05:00
committed by GitHub
parent 1944a0883e
commit ebddeee360
5 changed files with 37 additions and 9 deletions
+2 -3
View File
@@ -293,10 +293,10 @@ func (t tableImpl) ExportJSON(context context.Context, writer io.Writer) error {
return err
}
return t.doExportJSON(context, writer)
return t.doExportJSON(context, writer, true)
}
func (t tableImpl) doExportJSON(ctx context.Context, writer io.Writer) error {
func (t tableImpl) doExportJSON(ctx context.Context, writer io.Writer, start bool) error {
marshalOptions := protojson.MarshalOptions{
UseProtoNames: true,
Resolver: t.typeResolver,
@@ -304,7 +304,6 @@ func (t tableImpl) doExportJSON(ctx context.Context, writer io.Writer) error {
var err error
it, _ := t.List(ctx, nil)
start := true
for {
found := it.Next()