Fix the 'query' tool to work with the new column format
Database: allow max_int in columns