Database sqlbuilder

See commits and referenced bugs ;)