Stored procedures, take 2

Tomasz Rybak, in reply to the stored procedures entry says:

I've written such tool, and you can download it here: http://kwi.pb.bialystok.pl/~bogomips/autostoredprocedures-0.0.1.tar.gz. For now, it supports only PostgreSQL.

Short description:

  1. Written using MonoDevelop - so Makefile is generated by MD.
  2. I changed name of namespace and class from AutoSproc to AutoStoredProcedures, so these tools could be used at the same time.
  3. I haven't found DBProvider in Mono, so there are only two methods CreateInstance, both taking IDbConnection.
  4. All fields and methods are static.
  5. There is no possibility of saving generated module (but if one adds abiulder.Save(asseblyname) in CreateInstance, it saves dll) nor caching generated modules.
  6. I haven't tested it much, and haven't written test suite.
  7. I added StoredParameterNameAttribute, so one can change name of parameter given to stored procedure.
  8. Entire code is generated. AutoSproc has four worker methods ExecuteStoredProc*, but in my code no method are called from outside generated class.
  9. I think (but I'm not sure) that adding support to other databases will be simple: add CreateClassDATABASE and CreateMethodDATABASE, copy body of methods from Create*Npgsql, changing types from Npgsql* to other, and it should work - but I haven;t tested it.
This is a personal web page. Things said here do not represent the position of my employer.