export type DatabaseBackendKind = 'electron' | 'capacitor-sqlite' | 'browser';

/** Selects the persistence backend for the current runtime shell. */
export function resolveDatabaseBackend(input: {
  isElectron: boolean;
  isCapacitor: boolean;
}): DatabaseBackendKind {
  if (input.isElectron) {
    return 'electron';
  }

  if (input.isCapacitor) {
    return 'capacitor-sqlite';
  }

  return 'browser';
}
