function convert(schema) {
  if (typeof schema.version != 'number') {
    throw new Error('Schema version must be a number');
  }

  if (INVALID_DB_NAMES.indexOf(schema.name) != -1) {
    throw new Error('db name cannot be ' + INVALID_DB_NAMES.join(','));
  }


  var schemaBuilder = lf.schema.create(schema.name, schema.version);
  Object.keys(schema.table).forEach(
      function(tableName) {
        createTableDefinition(
            tableName, schema.table[tableName], schemaBuilder);
      });

  if (schema.pragma) {
    schemaBuilder.setPragma(/** @type {!Pragma_} */ (schema.pragma));
  }

  return schemaBuilder.getSchema();
}
@param {!Schema_} schema
@return {!lf.schema.Database}