Giter Club home page Giter Club logo

ecto_export's People

Contributors

liveforeverx avatar surik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

surik

ecto_export's Issues

export header

An export must be pre-/post-fixed with a header/footer.
preferably it should be a header but at the beginning of an export not all data may be available (at least not in an efficient and consistent way).

the following attributes should be included:

  • schema version
  • schema
  • timestamp
  • used filter (where: )
  • exported record count
  • username triggering the export
  • machine: host/maschine_id, erlang nodename, release version
  • jobid
  • environment: database name and version

some attributes may require further discussion or may be dropped because they are not available in the context of ecto_export but must be handled by exd.

export mandates writing to local filesystem

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.

persist job id

persist the last used job id so they are not given out twice if the application running ecto_export restarts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.