refactor db functions
Merge pull request #6 from Shibarshin/PyGGIS-1

refactor db functions