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 mandates writing to local filesystem #4

Open
thz opened this issue Aug 19, 2015 · 1 comment
Open

export mandates writing to local filesystem #4

thz opened this issue Aug 19, 2015 · 1 comment

Comments

@thz
Copy link

thz commented Aug 19, 2015

Quoting from the export docs:

  Start an export or import job.
  ## Params
  * `repo` - mandatory, the Ecto.Repo which contains the models to be exported
  * `models` - mandatory, list of modules which implement Ecto.Model
  * `options` - optional, Map whith the following options
    * `"filename"` - mandatory, string, the filename to export/import from
    * `"import"` - boolean, if true starts an import - default is false
    * `"formatter"` - atom, defines which module to use for string conversion - default is `Ecto.Export.Formatter.JSON`
  ## Result
  `{:ok, job_id}`

The mandatory option filename shows a painful limitation. ecto_export (as a low level library) must provide more flexible ways of accessing the data. Dumping data to stdout is the least ecto_export should support. That is todays "norm".
Compare to dump functionality of database systems, and even docker which allows piping whole images through a bare http-client based CLI. Compare to https://docs.docker.com/reference/api/docker_remote_api_v1.20/ REST endpoint GET /containers/(id)/export and still you can stream that on a UNIX system with the docker CLI.

@rixmann
Copy link

rixmann commented Aug 21, 2015

we had a meeting today and a lengthy discussion about ecto_export, regarding filename stdio etc. the following was decided:

the attribute filename is to be replaced by uri or export_uri
which is the endpoint to export to.

example values may be: scp:// file:// zmq-tcp://
only zmq-tcp (and maybe file which is the current behaviour) must be implemented at first.
for exporting to local filesystem use prefix: <configured_prefix>/<job_id>_filename

if the uri attribute is omitted, the data to export/import must be included with the request/response.

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

No branches or pull requests

2 participants