// PostgreSQL Column Compiler // ------- const ColumnCompiler = require('../../../schema/columncompiler'); const { isObject } = require('../../../util/is'); const { toNumber } = require('../../../util/helpers'); const commentEscapeRegex = /(? 'bigserial' + (primaryKey ? ' primary key' : ''); ColumnCompiler_PG.prototype.increments = ({ primaryKey = true } = {}) => 'serial' + (primaryKey ? ' primary key' : ''); ColumnCompiler_PG.prototype.bigint = 'bigint'; ColumnCompiler_PG.prototype.binary = 'bytea'; ColumnCompiler_PG.prototype.bool = 'boolean'; ColumnCompiler_PG.prototype.double = 'double precision'; ColumnCompiler_PG.prototype.floating = 'real'; ColumnCompiler_PG.prototype.smallint = 'smallint'; ColumnCompiler_PG.prototype.tinyint = 'smallint'; ColumnCompiler_PG.prototype.uuid = 'uuid'; function jsonColumn(client, jsonb) { if (!client.version || parseFloat(client.version) >= 9.2) return jsonb ? 'jsonb' : 'json'; return 'text'; } module.exports = ColumnCompiler_PG;