-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Export command #286
base: master
Are you sure you want to change the base?
Add Export command #286
Conversation
afaik most databases support exporting .sql files, why is this PR better? I found there is no way to import the data back. (I am reading #283) |
It would be nice if there is a common way to export a .sql, which has a similar effect as this PR. The problem is that when using sqlite backend no such builtin export function is available🤔 Or, maybe can use sqlite CLI to do so? But would it cause problems if it reads and writes at the same time with ledger on the sqlite db? |
sqlite cli can export .sql but yes, it does not support reading and writing at the same time. |
New features
/ledger export <params>
to export specific actions as CSV fileclass DataExporter(searchParams, exportAdapter)
to export actionsAbstructExportAdapter
->CsvExportAdapter
, allow to add more other export formats in futureledger.toml
Other Small Changes
ServerCommandSource
param inXXActionType.getObjectMessage
MessageUtils.instantToText
toMessageUtils.instantTimeToDiffText
to avoid name conflicts with new added functionspageSize
inTransaction.selectActionsSearch
to allow querying with custom page size (used by export)Example
Export to
./world/data/ledger-export-<time>.csv
in default.Exported CSV table looks like below: