/** * @param {string | array.string} path * Path or array of paths to files or directories with index definitions * @param {ValidateOptions} [options] */ constructor(path, options) { this.paths = isArrayLike(path) ? Array.from(path) : [path]; this.options = extend({logger: console}, options); }
defaultHeaders(){ const authorization = {} ; return extend({}, { 'Accept': 'application/json', 'Content-Type': 'text/plain' }, authorization); }
function createSchema (config) { const connection = mysql.createConnection(extend({ multipleStatements: true }, config)); connection.query( `CREATE DATABASE IF NOT EXISTS \`bookshelf\` DEFAULT CHARACTER SET = 'utf8' DEFAULT COLLATE 'utf8_general_ci'; USE \`bookshelf\`; CREATE TABLE IF NOT EXISTS \`bookshelf\`.\`books\` ( \`id\` INT UNSIGNED NOT NULL AUTO_INCREMENT, \`title\` VARCHAR(255) NULL, \`author\` VARCHAR(255) NULL, \`publishedDate\` VARCHAR(255) NULL, \`imageUrl\` VARCHAR(255) NULL, \`description\` TEXT NULL, \`createdBy\` VARCHAR(255) NULL, \`createdById\` VARCHAR(255) NULL, PRIMARY KEY (\`id\`));`, (err) => { if (err) { throw err; } console.log('Successfully created schema'); connection.end(); } ); }
/** * @param {IndexManager} manager * @param {array.IndexMutation} [mutations] * @param {PlanOptions} [options] */ constructor(manager, mutations, options) { this.manager = manager; this.options = extend(defaultOptions, options); this.mutations = addMutationsByPhase(mutations, []); }
/** * @param {IndexManager} manager * @param {string | array.string} path * Path or array of paths to files or directories with index definitions * @param {SyncOptions} [options] */ constructor(manager, path, options) { this.manager = manager; this.paths = isArrayLike(path) ? Array.from(path) : [path]; this.options = extend({logger: console}, options); if (this.paths.find((p) => p === '-')) { // Can't do interactive prompts if processing from stdin this.options.interactive = false; } }