Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
You are welcome. Thanks for the library! I have given it some more thought and I now realize local overrides for leiningen config might not be a good idea. Perhaps application configuration should be completely decoupled with packaging. I've found confijulate https://github.com/bbbates/confijulate, herehttp://stackoverflow.com/questions/17719976/idiomatic-config-managment-in-clojure. It might be useful. On Tue, May 27, 2014 at 8:02 AM, Michael Cramm gmcr...@gmail.com wrote: Good question. I had originally wanted a separate, untracked config file but couldn't decide on a format. (like separating out protocol, host, port, etc) Exporting the environment variable felt the most non-committal at the time. It wouldn't be too much work to have a file living in `resources/monarch/...`, and add another optional param to `project.clj` to tell monarch where to look. I'll see about adding this to the next version. Thanks for the feedback! On Sunday, 25 May 2014 21:16:56 UTC-6, Atamert Ölçgen wrote: Is there a reason why DATABASE_URL isn't in the project config? I guess a more relevant question would be to ask if there's something like a local config file for leiningen projects? Something that is per-project but ideally ignored by the VCS. Something that you can use to override what's inside the project.clj. On Sat, May 24, 2014 at 7:27 PM, Michael Cramm gmc...@gmail.com wrote: I realize that there are other database migration frameworks already availablefor clojure projects, but I always seem to run into issues pretty fast in trying to use them. This is also the first plugin I've developed and made publicly available, so I'd love some feedback! I've been using Clojure for a while now but I don't really have anyone mentoring me :). https://github.com/mcramm/monarch -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Kind Regards, Atamert Ölçgen -+- --+ +++ www.muhuk.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Kind Regards, Atamert Ölçgen -+- --+ +++ www.muhuk.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
On 27 May 2014 01:02, Michael Cramm gmcr...@gmail.com wrote: Good question. I had originally wanted a separate, untracked config file but couldn't decide on a format. (like separating out protocol, host, port, etc) Exporting the environment variable felt the most non-committal at the time. Don't underestimate the value of using environment variables for configuration: they are simple and effective, and allow for a lot of flexibility in testing and deployment. It wouldn't be too much work to have a file living in `resources/monarch/...`, and add another optional param to `project.clj` to tell monarch where to look. I'll see about adding this to the next version. Do configuration files really belong in resources? They will then be shipped with the compiled jar. From a DevOps point of view, we like to separate code from config, and certainly don't want to compile a new jar just to deploy with a different database configuration. Ray. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
Il giorno martedì 27 maggio 2014 08:16:49 UTC+2, Atamert Ölçgen ha scritto: You are welcome. Thanks for the library! Second that. I have given it some more thought and I now realize local overrides for leiningen config might not be a good idea. Perhaps application configuration should be completely decoupled with packaging. Indeed, I also agree with Ray Miller: configuration is environment-specific, the application is not (more or less). Environment variables are useful http://12factor.net/config, but they have some limitations and, as usual, there are tradeoffs involved. I've found confijulate https://github.com/bbbates/confijulate, herehttp://stackoverflow.com/questions/17719976/idiomatic-config-managment-in-clojure. It might be useful. Well, ok. Another configuration library that I wasn't aware of when I wrote confunion https://github.com/manuelp/confunion. Another one that I found *after* writing mine is carica https://github.com/sonian/carica, which seems quite good. There are a bunch of them out there, you can look into Clojure Toolbox http://www.clojure-toolbox.com/, probably there is already one that satisfies your use cases. Cheers, Manuel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
On 27 May 2014 09:35, Manuel Paccagnella manuel.paccagne...@gmail.com wrote: I've found confijulate, here. It might be useful. Well, ok. Another configuration library that I wasn't aware of when I wrote confunion. Another one that I found after writing mine is carica, which seems quite good. There are a bunch of them out there, you can look into Clojure Toolbox, probably there is already one that satisfies your use cases. Thank you for drawing all these configuration libraries to my attention, this is something I've done in an ad hoc way for the different applications I've written. I'll take a look at these before rolling my own next time. Ray. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
Nomad is an other tool like confijulate: https://github.com/james-henderson/nomad I use it in some projects and seems better documented that confijulate and uses edn as file format. Andrey 2014-05-27 10:43 GMT+02:00 Ray Miller r...@1729.org.uk: On 27 May 2014 09:35, Manuel Paccagnella manuel.paccagne...@gmail.com wrote: I've found confijulate, here. It might be useful. Well, ok. Another configuration library that I wasn't aware of when I wrote confunion. Another one that I found after writing mine is carica, which seems quite good. There are a bunch of them out there, you can look into Clojure Toolbox, probably there is already one that satisfies your use cases. Thank you for drawing all these configuration libraries to my attention, this is something I've done in an ad hoc way for the different applications I've written. I'll take a look at these before rolling my own next time. Ray. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Andrey Antukh - Андрей Антух - andrei.anto...@kaleidos.net / n...@niwi.be http://www.niwi.be http://www.niwi.be/page/about/ https://github.com/niwibe -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
Just to add to the chorus--environ (https://github.com/weavejester/environ) is a good, basic option which we've had lots of success using. (2014/05/27 18:08), Andrey Antukh wrote: Nomad is an other tool like confijulate: https://github.com/james-henderson/nomad I use it in some projects and seems better documented that confijulate and uses edn as file format. Andrey 2014-05-27 10:43 GMT+02:00 Ray Miller r...@1729.org.uk mailto:r...@1729.org.uk: On 27 May 2014 09:35, Manuel Paccagnella manuel.paccagne...@gmail.com mailto:manuel.paccagne...@gmail.com wrote: I've found confijulate, here. It might be useful. Well, ok. Another configuration library that I wasn't aware of when I wrote confunion. Another one that I found after writing mine is carica, which seems quite good. There are a bunch of them out there, you can look into Clojure Toolbox, probably there is already one that satisfies your use cases. Thank you for drawing all these configuration libraries to my attention, this is something I've done in an ad hoc way for the different applications I've written. I'll take a look at these before rolling my own next time. Ray. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com mailto:clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com mailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com mailto:clojure%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Andrey Antukh - Андрей Антух - andrei.anto...@kaleidos.net mailto:andrei.anto...@kaleidos.net / n...@niwi.be mailto:n...@niwi.be http://www.niwi.be http://www.niwi.be/page/about/ https://github.com/niwibe -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com mailto:clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
Good question. I had originally wanted a separate, untracked config file but couldn't decide on a format. (like separating out protocol, host, port, etc) Exporting the environment variable felt the most non-committal at the time. It wouldn't be too much work to have a file living in `resources/monarch/...`, and add another optional param to `project.clj` to tell monarch where to look. I'll see about adding this to the next version. Thanks for the feedback! On Sunday, 25 May 2014 21:16:56 UTC-6, Atamert Ölçgen wrote: Is there a reason why DATABASE_URL isn't in the project config? I guess a more relevant question would be to ask if there's something like a local config file for leiningen projects? Something that is per-project but ideally ignored by the VCS. Something that you can use to override what's inside the project.clj. On Sat, May 24, 2014 at 7:27 PM, Michael Cramm gmc...@gmail.comjavascript: wrote: I realize that there are other database migration frameworks already availablefor clojure projects, but I always seem to run into issues pretty fast in trying to use them. This is also the first plugin I've developed and made publicly available, so I'd love some feedback! I've been using Clojure for a while now but I don't really have anyone mentoring me :). https://github.com/mcramm/monarch -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- Kind Regards, Atamert Ölçgen -+- --+ +++ www.muhuk.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ANN] monarch 0.2.0 - Simple database migrations for Clojure.
I realize that there are other database migration frameworks already availablefor clojure projects, but I always seem to run into issues pretty fast in trying to use them. This is also the first plugin I've developed and made publicly available, so I'd love some feedback! I've been using Clojure for a while now but I don't really have anyone mentoring me :). https://github.com/mcramm/monarch -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.
Is there a reason why DATABASE_URL isn't in the project config? I guess a more relevant question would be to ask if there's something like a local config file for leiningen projects? Something that is per-project but ideally ignored by the VCS. Something that you can use to override what's inside the project.clj. On Sat, May 24, 2014 at 7:27 PM, Michael Cramm gmcr...@gmail.com wrote: I realize that there are other database migration frameworks already availablefor clojure projects, but I always seem to run into issues pretty fast in trying to use them. This is also the first plugin I've developed and made publicly available, so I'd love some feedback! I've been using Clojure for a while now but I don't really have anyone mentoring me :). https://github.com/mcramm/monarch -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Kind Regards, Atamert Ölçgen -+- --+ +++ www.muhuk.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Database migrations
Reginald, clearly late to the game on this thread :) but figured I'd share a project that I created recently ( clj-sql-up ). It is a leiningen plugin that is dead simple to use, and it doesn't try to over-abstract, but it also allows for dynamic sql generation since it runs from the context of a clojure file. I think it's simplest option out there for doing database migrations with clojure without sacrificing expressiveness Please let me know if you run into any issues, but should be quite easy to get rolling with: https://github.com/ckuttruff/clj-sql-up On Friday, June 14, 2013 9:24:39 AM UTC-7, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
Hello, few days ago I extracted DB migrations code from few of my pet projects into library called fun_migrations (https://github.com/maio/fun_migrations). I should probably also credit technomancy because in syme project he's using similar simple concept. It's just few lines of code so I didn't think it would be useful to make public, but seeing that someone else also came with similar code made me think that it might be useful to other people too. In my previous non-Clojure projects I have been using http://dbdeploy.com with great success, but there were times when I really needed to run some non-SQL code. With fun_migrations you can run arbitrary Clojure code in each migration, you can use multiple DB connections, etc... Please note that it's version 0.1.0 and it's also my first Clojure library so it might not be particularly stable. It works for my current use case, but it might not work for yours. M On Friday, June 14, 2013 6:24:39 PM UTC+2, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
To answer your first email, here's a Lobos based migration using the CHP framework https://github.com/runexec/chp#db-migrations. The configuration file is in resources/config/db.clj and is used by clojure.java.jdbc, KormSQL, and Lobos. 26.06.2013, 04:38, "Marian Schubert" marian.schub...@gmail.com:Hello, few days ago I extracted DB migrations code from few of my pet projects into library called fun_migrations (https://github.com/maio/fun_migrations). I should probably also credit technomancy because in syme project he's using similar simple concept. It's just few lines of code so I didn't think it would be useful to make public, but seeing that someone else also came with similar code made me think that it might be useful to other people too. In my previous non-Clojure projects I have been using http://dbdeploy.com with great success, but there were times when I really needed to run some non-SQL code. With fun_migrations you can run arbitrary Clojure code in each migration, you can use multiple DB connections, etc... Please note that it's version 0.1.0 and it's also my first Clojure library so it might not be particularly stable. It works for my current use case, but it might not work for yours. M On Friday, June 14, 2013 6:24:39 PM UTC+2, Reginald Choudari wrote:Hello all,I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure?Thanks in advance -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
On Friday, 14 June 2013 21:54:39 UTC+5:30, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? I have been maintaining a Clojure wrapper of Liquibase here: https://github.com/kumarshantanu/clj-liquibase However, I would recommend considering the new Liquibase 3.0 that accepts SQL scripts as well as YAML/JSON/XML files as changesets. With the new Liquibase there should be little reason to have DB migrations tied to any language or tool. http://www.liquibase.org/ Shantanu -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Database migrations
Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
Phil uses this really cool trick: https://github.com/technomancy/syme/blob/master/src/syme/db.clj#L66-L119 The benefit is that your migrations are just Clojure functions. No messing around with files or timestamps or whatever. Dead simple. I hope someone extracts it into a lib with tests around it. He won't on principle, saying copy/pasting it emphasizes just how simply this problem can be solved. But there's something to be said for using a tested lib in production code. On Fri, Jun 14, 2013 at 11:24 AM, Reginald Choudari adnanchowdhur...@gmail.com wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
Are you married with a database ? If so, make migrations with your database sql language. http://mybatis.org/migrations/ If that is the case Idiomatic migrations adds no value imho. On Friday, June 14, 2013 1:24:39 PM UTC-3, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
That is a good point. But another reason I wanted to do migrations through the application code was to automagically run migrations when the app was initially run, i.e. do a lein ring server-headless and it will automatically run migrations in order to start the web-app. On Friday, June 14, 2013 3:22:28 PM UTC-4, Geraldo Lopes de Souza wrote: Are you married with a database ? If so, make migrations with your database sql language. http://mybatis.org/migrations/ If that is the case Idiomatic migrations adds no value imho. On Friday, June 14, 2013 1:24:39 PM UTC-3, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
There are also following libraries to handle migrations: Ragtime: https://github.com/weavejester/ragtime Lobos: https://github.com/budu/lobos Lobos has its own DSL to implement database manipulation. Ragtime uses normal Clojure functions instead. On Friday, June 14, 2013 7:24:39 PM UTC+3, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
Inspired by Technomancy's suggestion to try a simpler approach to migrations on IRC, I came up with this tiny library based heavily on code from the clojars repo, that Phil pointed me to. Personally, I thought Ragtime and Lobos, were overkill. https://github.com/runa-dev/kits/blob/master/src/kits/db_migrator.clj On Fri, Jun 14, 2013 at 3:32 PM, Juha Syrjälä juha.syrj...@gmail.comwrote: There are also following libraries to handle migrations: Ragtime: https://github.com/weavejester/ragtime Lobos: https://github.com/budu/lobos Lobos has its own DSL to implement database manipulation. Ragtime uses normal Clojure functions instead. On Friday, June 14, 2013 7:24:39 PM UTC+3, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/**macourtney/drifthttps://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
We used drift for a while, but found it didn't add much over plain sql, and was forcing us to write down migrations, which imho are a mistake. We ended up moving to Flyway, a very straightforward Java migration library, with a thin clojure wrapper. This has the advantages of using plain sql files for migrations, and having a command-line migration tool that is very handy for running migrations on prod. - Korny On 15 Jun 2013 09:41, Alex Baranosky alexander.barano...@gmail.com wrote: Inspired by Technomancy's suggestion to try a simpler approach to migrations on IRC, I came up with this tiny library based heavily on code from the clojars repo, that Phil pointed me to. Personally, I thought Ragtime and Lobos, were overkill. https://github.com/runa-dev/kits/blob/master/src/kits/db_migrator.clj On Fri, Jun 14, 2013 at 3:32 PM, Juha Syrjälä juha.syrj...@gmail.comwrote: There are also following libraries to handle migrations: Ragtime: https://github.com/weavejester/ragtime Lobos: https://github.com/budu/lobos Lobos has its own DSL to implement database manipulation. Ragtime uses normal Clojure functions instead. On Friday, June 14, 2013 7:24:39 PM UTC+3, Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/**macourtney/drifthttps://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
Migratus seems to be pretty similar to this, is a nice small library. I've used it and it works well. https://github.com/pjstadig/migratus -ken -- On Fri, Jun 14, 2013 at 11:44:08AM -0500, Steven Degutis wrote: Phil uses this really cool trick: https://github.com/technomancy/syme/blob/master/src/syme/db.clj#L66-L119 The benefit is that your migrations are just Clojure functions. No messing around with files or timestamps or whatever. Dead simple. I hope someone extracts it into a lib with tests around it. He won't on principle, saying copy/pasting it emphasizes just how simply this problem can be solved. But there's something to be said for using a tested lib in production code. On Fri, Jun 14, 2013 at 11:24 AM, Reginald Choudari adnanchowdhur...@gmail.com wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Database migrations
Coming from the Rails world, for a while I searched for a way to do this, and at this point I've come to the conclusion that * raw SQL migrations are the way to go * rollback/down migrations are problematic for environments other than test. Regarding specific experiences, I used Lobos for a while, and while I don't hate it, I quickly ran into situations where its DSL just didn't cover the types or alterations I wanted to make, and it ended up causing more issues than it solved. My choice was to extend it or just use SQL directly. In another project I was using Flyway (http://flywaydb.org/), which does everything it needs to reasonably well, explicitly doesn't support rollbacks, and uses SQL which supports everything I need. It's database schema table is easy enough to understand that I can manually rollback during testing/development or write some scripting to handle specific cases if need be. So I've started moving in that direction. TL;DR straight SQL is the way to go, and what Korny said in another reply. DD (2013/06/15 1:24), Reginald Choudari wrote: Hello all, I am trying to implement database migrations with Clojure. So far I have been looking at Drift (https://github.com/macourtney/drift) as a candidate for implementing this. My question is, does anyone have a database migration workflow that they use and would like to share? One problem I have been thinking is how to tackle database credentials/db name configuration. I know in Rails its common to use a YAML to provide this info, wondering if there was something more idiosyncratic to clojure? Thanks in advance -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Rails-like database migrations for use with clojure.contrib.sql
On 26 February 2010 23:37, Matt macourt...@gmail.com wrote: I've had rails like migrations working in Conjure (0.4 coming soon) for a while. You may want to look at it for some help. Thanks for the links Matt, I'll certainly take a look when I have some more time. I implemented these migrations for a small application, so I wanted something lightweight and simple. Consequently I've not been too concerned about portability across databases, as I'm confident derby will be all we'll ever need (for this application). To keep things simple I also opted to have the migrations specified in a single clojure file, as a single sorted-map. I'm not expecting to have a large database full of tables, and I find having the schema defined in a single file is easier to read. This approach might not scale to larger projects, but for smaller ones I'm hoping it'll be adequate. Any comments you and others might have on the code idioms used would be appreciated though... As I'm sure it can be tidied up a fair bit. To deal with the table schema problem, I had to create flavors for each database Conjure supports. I don't think there's much you can do to avoid flavors when you're trying to reflect on tables in a database. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Rails-like database migrations for use with clojure.contrib.sql
I've made a stab at implementing rails-like database migrations for use with clojure.contrib.sql. The codes currently very crude, but I'd appreciate any comments on style/utility: http://gist.github.com/315787 Currently the hariest bit is in testing whether or not we need to construct the schemaversion table. It does this via exceptions right now which is very ugly (especially because of nested exceptions etc..), but I couldn't figure out how to get derby to test for the presence of the table. Anyway, I'd appreciate any feedback and criticism. Also I noticed that clojure.contrib.sql doesn't have support for creating views. Is this a deliberate design choice, or just an omission? -- Rick Moynihan http://twitter.com/RickMoynihan http://delicious.com/InkyHarmonics http://sourcesmouth.co.uk/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Rails-like database migrations for use with clojure.contrib.sql
I've had rails like migrations working in Conjure (0.4 coming soon) for a while. You may want to look at it for some help. To deal with the table schema problem, I had to create flavors for each database Conjure supports. I don't think there's much you can do to avoid flavors when you're trying to reflect on tables in a database. Files of interest in Conjure: http://github.com/macourtney/Conjure/blob/master/file_structure/default/script/migrate.clj Everything in: http://github.com/macourtney/Conjure/tree/master/file_structure/default/vendor/conjure/migration/ Database flavors: http://github.com/macourtney/Conjure/tree/master/file_structure/default/db/flavors/ I hope that helps. -Matt Courtney On Feb 26, 10:35 am, Rick Moynihan rick.moyni...@gmail.com wrote: I've made a stab at implementing rails-like database migrations for use with clojure.contrib.sql. The codes currently very crude, but I'd appreciate any comments on style/utility: http://gist.github.com/315787 Currently the hariest bit is in testing whether or not we need to construct the schemaversion table. It does this via exceptions right now which is very ugly (especially because of nested exceptions etc..), but I couldn't figure out how to get derby to test for the presence of the table. Anyway, I'd appreciate any feedback and criticism. Also I noticed that clojure.contrib.sql doesn't have support for creating views. Is this a deliberate design choice, or just an omission? -- Rick Moynihanhttp://twitter.com/RickMoynihanhttp://delicious.com/InkyHarmonicshttp://sourcesmouth.co.uk/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en