diff --git a/data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java b/data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java new file mode 100644 index 00000000..ad87de1c --- /dev/null +++ b/data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java @@ -0,0 +1,25 @@ +package one.nem.lacerta.source.db.dao; + +import androidx.room.Dao; +import androidx.room.Query; + +import java.util.List; + +import one.nem.lacerta.source.db.entity.Repositories; + +@Dao +public interface RepositoriesDao { + + @Query("SELECT * FROM repositories") + List getAll(); + + @Query("SELECT * FROM repositories WHERE id IN (:ids)") + List loadAllByIds(int[] ids); + + @Query("SELECT * FROM repositories WHERE relative_path LIKE :relativePath LIMIT 1") + Repositories findByRelativePath(String relativePath); + + @Query("SELECT * FROM repositories WHERE id LIKE :id LIMIT 1") + Repositories findById(String id); + +}