I think it can be a dangerous road trying to create abstractions over data sources. It can be a lot of work maintaining a stub/mock implementation to work alongside a database, and sometimes it's not that much more work (or less work) to install Postgres, SQLite, or whatever you're using, locally.
One of the pain points of working with databases is managing their state, and this is one of the reasons why stub/mock implementations initially look attractive. However, there are solid alternative approaches to making the job of managing databases a lot easier. For example, https://github.com/juxt/joplin is a good choice for managing database schema migrations, seeding databases with state (for test setups) and has a good range of supported data sources. (Disclosure: I work for juxt) On Thursday, April 30, 2015 at 4:54:38 AM UTC+1, Andy Chambers wrote: > > Hi All, > > I'm trying to follow the "component" architecture for an app I'm working > on and wondered if I was missing something. In the "Just enough structure" > talk, one of the examples Stuart presents is a DB component that contains > just a small selection of DB related functions (i.e. insert, and query > IIRC) so that when you need to mock it out for your tests, you don't have > to implement the entire JDBC interface. > > This makes sense but I'm wondering if anyone has released such a subset > (possibly expanded to include things like transactions, and maybe a few > utility query builders) as open source ideally with a corresponding mock > implementation. With the popularity of the component library, I'm surprised > not to find ready made components I can just plug into my app. > > If there's nothing like this already, then I guess I have an idea for a > new project. Anyone think this is a good idea or would everyone's ideal DB > component look a little different? Look forward to hearing your thoughts. > > Cheers, > Andy > -- 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.