Skip to content

Leverage Ecto associations to deep clone db records

License

Notifications You must be signed in to change notification settings

grantwest/ecto_clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages