static SettingsDBAdapter getAdapter(String tableName, DBHandle handle, OpenMode openMode,
			AddressMap addrMap, TaskMonitor monitor)
			throws VersionException, IOException, CancelledException {

		if (openMode == OpenMode.CREATE) {
			return new SettingsDBAdapterV1(tableName, handle, true);
		}

		if (openMode == OpenMode.IMMUTABLE) {
			return findReadOnlyAdapter(tableName, handle);
		}

		try {
			SettingsDBAdapter adapter = new SettingsDBAdapterV1(tableName, handle, false);
			if (addrMap != null && addrMap.isUpgraded()) {
				throw new VersionException(true);
			}
			return adapter;
		}
		catch (VersionException e) {
			if (!e.isUpgradable() || openMode == OpenMode.UPDATE) {
				throw e;
			}
			SettingsDBAdapter adapter = findReadOnlyAdapter(tableName, handle);
			if (openMode == OpenMode.UPGRADE) {
				adapter = upgrade(handle, adapter, addrMap, monitor);
			}
			return adapter;
		}
	}
Get a settings adapter.
NOTE: Support for read-only mode for older versions must be retained.
@param tableName settings DB table name
@param handle database handle
@param openMode database open mode
@param addrMap address map (should only be specified when association IDs 
correspond to address key, otherwise should be null).
@param monitor task monitor
@return settings adapter instance
@throws VersionException if schema version does not match current version
@throws IOException if there was a problem accessing the database
@throws CancelledException if task cancelled
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/SettingsDBAdapter.java