mirror of
https://github.com/knex/knex.git
synced 2025-07-05 08:01:09 +00:00
29 lines
740 B
JavaScript
29 lines
740 B
JavaScript
const ColumnCompiler = require('../../../schema/columncompiler');
|
|
|
|
// Column Compiler
|
|
// -------
|
|
|
|
class ColumnCompiler_SQLite3 extends ColumnCompiler {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.modifiers = ['nullable', 'defaultTo'];
|
|
}
|
|
|
|
// Types
|
|
// -------
|
|
|
|
enu(allowed) {
|
|
return `text check (${this.formatter.wrap(
|
|
this.args[0]
|
|
)} in ('${allowed.join("', '")}'))`;
|
|
}
|
|
}
|
|
|
|
ColumnCompiler_SQLite3.prototype.json = 'json';
|
|
ColumnCompiler_SQLite3.prototype.jsonb = 'json';
|
|
ColumnCompiler_SQLite3.prototype.double = ColumnCompiler_SQLite3.prototype.decimal = ColumnCompiler_SQLite3.prototype.floating =
|
|
'float';
|
|
ColumnCompiler_SQLite3.prototype.timestamp = 'datetime';
|
|
|
|
module.exports = ColumnCompiler_SQLite3;
|