mirror of
https://github.com/knex/knex.git
synced 2025-08-16 04:31:05 +00:00
18 lines
560 B
JavaScript
18 lines
560 B
JavaScript
var baseSchemaGrammar = require('../../base/sqlite3/schemagrammar').schemaGrammar;
|
|
|
|
exports.schemaGrammar = _.defaults({
|
|
|
|
handleResponse: function(builder, resp) {
|
|
// This is an array, so we'll assume that the relevant info is on the first statement...
|
|
resp = resp[0];
|
|
var ctx = resp[1]; resp = resp[0];
|
|
if (builder.type === 'tableExists') {
|
|
return resp.length > 0;
|
|
} else if (builder.type === 'columnExists') {
|
|
return _.findWhere(resp, {name: builder.bindings[1]}) != null;
|
|
}
|
|
return resp;
|
|
}
|
|
|
|
}, baseSchemaGrammar);
|