function createStatement(query) {
    try {
      // Just return the statement right away if it's okay
      return formService.DBConnection.createStatement(query);
    }
    catch(ex) {
      // Assume guid column must not exist yet, so add it with an index
      formService.DBConnection.executeSimpleSQL(
        "ALTER TABLE moz_formhistory ADD COLUMN guid TEXT");
      formService.DBConnection.executeSimpleSQL(
        "CREATE INDEX IF NOT EXISTS moz_formhistory_guid_index " +
        "ON moz_formhistory (guid)");
    }

    // Try creating the query now that the column exists
    return formService.DBConnection.createStatement(query);
  }
/**
   * createStatement
   *
   * Creates a statement from a SQL string.  This function is borrowed
   * from Weave's forms.js.
   *
   * @param query The SQL query string
   * @return the mozIStorageStatement created from the specified SQL
   */
createStatement
Creates a statement from a SQL string.  This function is borrowed
from Weave's forms.js.

@param query The SQL query string
@return the mozIStorageStatement created from the specified SQL
createStatement Creates a statement from a SQL string . This function is borrowed from Weave ' s forms . js . @param query The SQL query string @return the mozIStorageStatement created from the specified SQL
function createStatement(query) {
    try {
      return formService.DBConnection.createStatement(query);
    }
    catch(ex) {
      formService.DBConnection.executeSimpleSQL(
        "ALTER TABLE moz_formhistory ADD COLUMN guid TEXT");
      formService.DBConnection.executeSimpleSQL(
        "CREATE INDEX IF NOT EXISTS moz_formhistory_guid_index " +
        "ON moz_formhistory (guid)");
    }
    return formService.DBConnection.createStatement(query);
  }
function createStatement ( query ) { try { return formService . DBConnection . createStatement ( query ) ; } catch ( ex ) { formService . DBConnection . executeSimpleSQL ( "ALTER TABLE moz_formhistory ADD COLUMN guid TEXT" ) ; formService . DBConnection . executeSimpleSQL ( "CREATE INDEX IF NOT EXISTS moz_formhistory_guid_index " + "ON moz_formhistory (guid)" ) ; } return formService . DBConnection . createStatement ( query ) ; }
createStatement
 Creates a statement from a SQL string.
createStatement Creates a statement from a SQL string .
// Just return the statement right away if it's okay // Assume guid column must not exist yet, so add it with an index // Try creating the query now that the column exists