removed mysql dependency
don't closeSync() if nothing was opened
support for postgres