upsert method

Future<void> upsert(
  1. WindowPreferences prefs
)

Creates or updates the provided prefs in the database.

Implementation

Future<void> upsert(WindowPreferences prefs) async {
  await safe((db) async {
    await db
        .into(db.windowRectangles)
        .insertReturning(
          prefs.toDb(),
          onConflict: DoUpdate((_) => prefs.toDb()),
        );
  });
}