Skip to content

A Gradle plugin to help you finding out right queries when you upgrade your room schemas.

Notifications You must be signed in to change notification settings

PrashamTrivedi/RoomUpgradeHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Room Upgrade helper

A Gradle plugin to help you finding out right queries when you upgrade your room schemas.

Installation

Add the following to your build.gradle

In Groovy

plugins {
  id "com.prashamhtrivedi.roomupgradehelper" version "0.1"
}

In Kotlin

plugins {
  id("com.prashamhtrivedi.roomupgradehelper") version "0.1"
}

Or

In Groovy

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.prashamhtrivedi:roomUpgradeHelper:0.1"
  }
}

apply plugin: "com.prashamhtrivedi.roomupgradehelper"

In Kotlin

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("gradle.plugin.com.prashamhtrivedi:roomUpgradeHelper:0.1")
  }
}

apply(plugin = "com.prashamhtrivedi.roomupgradehelper")

Usage

You have to define the location of schema json generated by room. You can do so by adding following block.

 roomUpgrade {
    jsonPath YourSchemaPath (e.g. "$projectDir/schemas")
 }

Room will add json schema every time you upgrade your database models and DB version.

This plugin will read those json files, find out the difference and will show you the queries you have to run in your migration grouped by each upgrade from version to version.

To get these queries, you have to run getStatements task added by this plugin.

About

A Gradle plugin to help you finding out right queries when you upgrade your room schemas.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages