Skip to content

Add --data-from-json option for initialization of emulator data#9

Merged
ohaibbq merged 4 commits into
candidate/rb20240328from
dan/candidate-json-source
Apr 11, 2024
Merged

Add --data-from-json option for initialization of emulator data#9
ohaibbq merged 4 commits into
candidate/rb20240328from
dan/candidate-json-source

Conversation

@ohaibbq

@ohaibbq ohaibbq commented Apr 10, 2024

Copy link
Copy Markdown

The JSON parser is exponentially faster than the YAML parser for large files

@ethan-oro ethan-oro left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks amazing ✨

Comment thread server/testdata/data.json
]
}
]
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: newline

Comment thread cmd/bigquery-emulator/main.go Outdated
LogFormat server.LogFormat `description:"specify the log format (console/json)" long:"log-format" default:"console"`
Database string `description:"specify the database file if required. if not specified, it will be on memory" long:"database"`
DataFromYAML string `description:"specify the path to the YAML file that contains the initial data" long:"data-from-yaml"`
DataFromJSON string `description:"specify the path to the JSON file that contains the initial data (faster for large files)" long:"data-from-json"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a sense at what size, in general, you would recommend switching from yaml to json? could be helpful to have a general sense (either here or in a doc somewhere) to guide folks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the helpdoc to say "multi-megabyte"

@ageiduschek ageiduschek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments outside of Ethan's!

@ohaibbq ohaibbq merged commit 70d2848 into candidate/rb20240328 Apr 11, 2024
@ohaibbq ohaibbq deleted the dan/candidate-json-source branch August 21, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants