Is there a dbmaintain like tool for Clojure?
I'd like to use SQL directly for DDL instead of a DSL, using a DSL for DML and queries is fine.
I've written a very simple leiningen plugin for migrations that utilizes plain sql. It runs in the context of a clojure file, so these sql strings can still be dynamically generated.
Check out:
https://github.com/ckuttruff/clj-sql-up
I started the project recently so feedback would be very welcome.
perhaps I'm misunderstanding your question, though it seems that dbmaintain is a tool for automating the deployment and maintenance of SQL database schemas. It is capable of ensuring that the database is in the correct configuration (schemas etc.) to run a particular version of a program. This sounds like dbmaintain would match well with programs written in Clojure so it should be fine to use it as is, unless dbmaintain has some other features that are more tightly intergrated with the code?
Lobos is a similar tool for Clojure. The default way to do DDL is with a Clojure DSL, so it might not fit your requirements.
As there was no dbmaintain integration for Clojure available, we wrote our own https://github.com/mysema/lein-dbmaintain
lein-dbmaintain integrates dbmaintain into leiningen
Related
I was wondering what autotest tools exists for clojure. In Ruby I have ZenTest, redgreeen etc to continuously keep on testing my code. I would like to have something similar for Clojure
So far I have found this simple script https://github.com/devn/clojure-autotest on the github. A bit crude for my taste. All tests run when a change occurrs. Also it may blurt out a long stacktrace in case of syntax errors, obscuring what goes wrong.
Take a look at the Testing section on the Leiningen plugin page.
Notably there's lein-autotest for Stuart Sierras lazytest framework and speclj.
If you are using clojure.test there are a few options available. lein-test-refresh is what I use (I'm also the author). Other options include quickie and prism.
If you use expectations then there is lein-autoexpect. I'm also the author of that.
Midje has built in support for autotesting. I'm not sure what the options are for Speclj.
What would you suggest to use in the following scenario:
Desktop application in C++
Cross platform (might use wxwidgets)
Sqlite3 DB (no concurrent accesses by different users)
Would like some kind of configurable lazy loading mechanism, meaning certain parts of an object can be loaded at different moments.
I would like to use an ORM to reduce CRUD code, is there any of them that fits the bill?
Do I need to write my own ORM?
Thank you and best regards.
ODB is a C++ ORM released under GPL (or a purchasable commercial license) that supports SQLite. It also supports lazy-loading of relationships and is cross-platform.
See http://www.codesynthesis.com/products/odb/features.xhtml for details.
Qt is an excellent cross-platform development environment, and someone's written an ORM which goes well with it.
Can you elaborate on the requirements for lazy loading?
I'm trying to find open source applications using PostgreSQL that are written in C/C++ so I can study them. A few open source projects using PostgreSQL are Evergreen ILS, SpamAssassin, and pgpool. However, Evergreen and SpamAssassin are written in Perl, and pgpool (written in C) is a replication tool, not a typical application. Moreover, I looked at the SQL code in Evergreen, and it is quite voluminous and complicated.
Hence, I'm looking for one or more applications using PostgreSQL, preferably those that are somewhat trivial (but not too trivial).
seen libpqxx? try asking on its mailing list (but scour their wiki first)
http://pqxx.org/development/libpqxx
pgAdmin is written using c++ using wxwidgets.
how about pgAdmin 3 ?
Also, you may find Qt4 a very easy way interact with databases programming in C++.
http://doc.trolltech.com/4.6-snapshot/sql-programming.html
Have you searched through the projects at http://pgfoundry.org ?
Two examples that are open-source:
Kexi (see kexi-project.org)
FOST4 (
http://support.felspar.com/Fost%204 )
It's pretty big, but the KDE Project's Amarok is written in C++ and can use a PgSQL backend (among several others). While it's pretty large, you may be able to find some interesting things in the database code. Since it uses a pre-defined schema (as opposed to the extremely general types of access that something like pgAdmin uses) it may have some good things to teach you. It will definitely be easier to pick apart than Evergreen, which actually has an entire middleware layer that actually does the data access through exposed services (The OpenSRF Project).
Do we have any tools to unit testing Sybase databases around?
i am not able to find one in http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks
i am looking out for a tool that can allow me to unit test Stored procedure.Something like wee do with utPLSQL.This tool will be used by Database guys to unit test.
What exactly do you want to test? The correctness of Sybase itself or some stored procedures you've written that run in Sybase? If the latter, then you could use JUnit to execute the stored procedures via JDBC (I'm assuming based on your username that Java is a language you're comfortable with).
I've been looking in to SqlUnit for xUnit level testing of stored procedures and such. It seems promising. I'm installing and fiddling with it now.
Please try to use AnyDbTest first, (www.anydbtest.com). I think it is the very tool you are finding. even through the AnyDbTest is not support sybase at this moment. We are working to support Sybase these days.
We're developing in C++ under Linux and about to set up automated tests. We intend to use a testing framework like CppUnit oder CxxTest. We're using Ant to build the software and we will also use it to run the tests.
As some tests are going to involve database access, we are looking for a tool or framework which facilitates the tasks of preparing and cleaning up test data in the database - just like DbUnit (a JUnit extension) in the Java world.
Another option may be to employ the actual DbUnit - a Java VM is available. Making use of DbUnit's Ant task seems to be most promising. Any related field reports are welcome!
I would recommend boost unit testing. You would probably have to use the setup and teardown to manually clean up the database. Of course, you could build your own C++ DbUnit in ODBC. IF you do let me know because I could use this as well!
I suppose you have your own C++ api to work with DB.
If it is true, you'd better to do all your DB preparation by your own. In that case you will test your DB API as well.
As there seems to be no DbUnit-like tool for C++ development, we've built a little framework of our own. Basically it's an adaptor for calling actual DbUnit operations from within C/C++ testrunners. It makes use of the Ant tasks provided by DbUnit.
We defined some macros like TS_DB_INSERT(filename) which call system("ant -Ddb.dataset=filename db.insert") and the like.
In this case, db.insert is an Ant target which executes a DbUnit task performing an INSERT operation on the database. The filename references an XML dataset containing the data to insert.
There's also an assertion macro which wraps a DbUnit compare.
The test case might look like this:
void testDatabaseStuff
{
TS_DB_INSERT("input.xml");
TestedClass::doSomething();
TS_DB_ASSERT("expected.xml");
}