Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EctoClone

Build Status Version Hex Docs Download License Last Updated

Take advantage of Ecto associations to deep clone data in your database.

To clone a post with it's comments and tags:

{:ok, cloned_post_id} = EctoClone.clone(%Post{id: 5}, Repo, %{title: "new title"}, [Comment, PostTag])

See clone docs for more information and examples.

Todo

  • error when intermediate schemas are missing
  • support mysql
  • support sqlite
  • clone tables in parallel
  • fix self references in parallel
  • support foreign key != :id
  • error when circular associations

About

Leverage Ecto associations to deep clone db records

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages