add usage db functions sql to contrib