Skip to content
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

Export schema in a file without unnecessary lines #199

Open
izmalk opened this issue Mar 17, 2023 · 1 comment
Open

Export schema in a file without unnecessary lines #199

izmalk opened this issue Mar 17, 2023 · 1 comment

Comments

@izmalk
Copy link

izmalk commented Mar 17, 2023

Problem to Solve

We have an export feature that includes database schema {db-name} command.

But the output of the command is straight to the console.

While for export we would like to have a file output. Especially if we have a long schema that can't fit the console.

We can go with the following:

typedb console --command="database schema db-name" > ~/schema.tql

But it provides not only the result but also some addons — at least the first line contains + database schema db-name text. So the resulting file can't be used for import without additional (trivial) editing.

That is very inconvenient for the automation of these tasks with export (backup).

Current Workaround

  1. Export the file.
  2. Delete the first line.
  3. Import the file.

Proposed Solution

Make it possible to export the file ready to be imported. With the same or different (e.g. "export") single command.

Additional Information

schema_cti.tql.zip

@izmalk
Copy link
Author

izmalk commented Mar 17, 2023

Alternatively, we can modify the data export feature of typedb to include schema in tql format (probably as a separate file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant