// Path: RxDbFlow-Rx2/src/main/java/au/com/roadhouse/rxdbflow/rx2/sql/observables/DBFlowExecuteCompletable.java
// public class DBFlowExecuteCompletable<TModel> extends DBFlowBaseCompletable<TModel>  {
// 
//     private final BaseQueriable mBaseQueriable;
//     private final DatabaseWrapper mDatabaseWrapper;
// 
//     /**
//      * Creates a new Observable which executes a sql statement against a table
//      * @param clazz The model class representing the table to execute against
//      * @param modelQueriable The query to execute
//      * @param databaseWrapper The database in which the target table resides
//      */
//     public DBFlowExecuteCompletable(Class<TModel> clazz, BaseQueriable modelQueriable, @Nullable DatabaseWrapper databaseWrapper) {
//         super(clazz);
//         mBaseQueriable = modelQueriable;
//         mDatabaseWrapper = databaseWrapper;
//     }
// 
// 
//     public Completable notifyOfUpdates(){
//         return new NotifyOfUpdate<>(this, mBaseQueriable.getQuery(), getPrimaryModelClass());
//     }
// 
//     @Override
//     public void run() {
//         if(mDatabaseWrapper != null) {
//             mBaseQueriable.execute(mDatabaseWrapper);
//         } else {
//             mBaseQueriable.execute();
//         }
//     }
// }
// 
// Path: RxDbFlow-Rx2/src/main/java/au/com/roadhouse/rxdbflow/rx2/sql/observables/DBFlowSingle.java
// public abstract class DBFlowSingle<T> extends Single<T> implements ValueAction<T> {
// 
//     /**
//      * Observes changes on the current table, restarting the query on change and emits the new count
//      * to any subscribers
//      * @return An observable which observes any changes in the current table
//      */
//     public final Observable<T> restartOnChange(){
//         return new DBFlowRestartOnChange<>(this.toObservable(), new Class[]{getPrimaryModelClass()}, this);
//     }
// 
//     /**
//      * Observes changes for specific tables, restarting the query on change and emits the new count
//      * to any subscribers
//      * @param tableToListen The tables to observe for changes
//      * @return An observable which observes any changes in the specified tables
//      */
//     public final Observable<T> restartOnChange(Class... tableToListen){
//         return new DBFlowRestartOnChange<>(this.toObservable(), tableToListen, this);
//     }
// 
//     /**
//      * Returns the class for the primary table model effected by this query
//      * @return The class for the primary table model
//      */
//     protected abstract Class getPrimaryModelClass();
// 
// }


import android.database.Cursor;
import com.raizlabs.android.dbflow.sql.language.property.IProperty;
import com.raizlabs.android.dbflow.structure.database.DatabaseWrapper;
import au.com.roadhouse.rxdbflow.rx2.sql.observables.DBFlowExecuteCompletable;
import au.com.roadhouse.rxdbflow.rx2.sql.observables.DBFlowSingle;
package au.com.roadhouse.rxdbflow.rx2.sql.language;




public interface QueriableObservable {

    /**
     * Creates an Single that emits a long value. This should be paired with {@link RxSQLite#selectCountOf(IProperty[])}
     * or a query that returns a single long/integer value. Calling this on any other query could result in unexpected return values
     *
     * @return An Single that emits a long result
     */
    DBFlowSingle<Long> asCountSingle();

    /**
     * Creates an Single that emits a long value. This should be paired with {@link RxSQLite#selectCountOf(IProperty[])}
     * or a query that returns a single long/integer value. Calling this on any other query could result in an unexpected emitted
     * value
     *
     * @param databaseWrapper The database wrapper to use for the query
     * @return An Single that emits a long result
     */
    DBFlowSingle<Long> asCountSingle(DatabaseWrapper databaseWrapper);

    /**
     * Creates an Single that executes a SQL statement. This is usually used with CRUD statements as
     * it only emits a Void value
     *
     * @return An Single that executes a SQL statement
     */
// Path: RxDbFlow-Rx2/src/main/java/au/com/roadhouse/rxdbflow/rx2/sql/observables/DBFlowExecuteCompletable.java
// public class DBFlowExecuteCompletable<TModel> extends DBFlowBaseCompletable<TModel>  {
// 
//     private final BaseQueriable mBaseQueriable;
//     private final DatabaseWrapper mDatabaseWrapper;
// 
//     /**
//      * Creates a new Observable which executes a sql statement against a table
//      * @param clazz The model class representing the table to execute against
//      * @param modelQueriable The query to execute
//      * @param databaseWrapper The database in which the target table resides
//      */
//     public DBFlowExecuteCompletable(Class<TModel> clazz, BaseQueriable modelQueriable, @Nullable DatabaseWrapper databaseWrapper) {
//         super(clazz);
//         mBaseQueriable = modelQueriable;
//         mDatabaseWrapper = databaseWrapper;
//     }
// 
// 
//     public Completable notifyOfUpdates(){
//         return new NotifyOfUpdate<>(this, mBaseQueriable.getQuery(), getPrimaryModelClass());
//     }
// 
//     @Override
//     public void run() {
//         if(mDatabaseWrapper != null) {
//             mBaseQueriable.execute(mDatabaseWrapper);
//         } else {
//             mBaseQueriable.execute();
//         }
//     }
// }
// 
// Path: RxDbFlow-Rx2/src/main/java/au/com/roadhouse/rxdbflow/rx2/sql/observables/DBFlowSingle.java
// public abstract class DBFlowSingle<T> extends Single<T> implements ValueAction<T> {
// 
//     /**
//      * Observes changes on the current table, restarting the query on change and emits the new count
//      * to any subscribers
//      * @return An observable which observes any changes in the current table
//      */
//     public final Observable<T> restartOnChange(){
//         return new DBFlowRestartOnChange<>(this.toObservable(), new Class[]{getPrimaryModelClass()}, this);
//     }
// 
//     /**
//      * Observes changes for specific tables, restarting the query on change and emits the new count
//      * to any subscribers
//      * @param tableToListen The tables to observe for changes
//      * @return An observable which observes any changes in the specified tables
//      */
//     public final Observable<T> restartOnChange(Class... tableToListen){
//         return new DBFlowRestartOnChange<>(this.toObservable(), tableToListen, this);
//     }
// 
//     /**
//      * Returns the class for the primary table model effected by this query
//      * @return The class for the primary table model
//      */
//     protected abstract Class getPrimaryModelClass();
// 
// }


// Path: RxDbFlow-Rx2/src/main/java/au/com/roadhouse/rxdbflow/rx2/sql/language/QueriableObservable.java
import android.database.Cursor;
import com.raizlabs.android.dbflow.sql.language.property.IProperty;
import com.raizlabs.android.dbflow.structure.database.DatabaseWrapper;
import au.com.roadhouse.rxdbflow.rx2.sql.observables.DBFlowExecuteCompletable;
import au.com.roadhouse.rxdbflow.rx2.sql.observables.DBFlowSingle;

package au.com.roadhouse.rxdbflow.rx2.sql.language;




public interface QueriableObservable {

    /**
     * Creates an Single that emits a long value. This should be paired with {@link RxSQLite#selectCountOf(IProperty[])}
     * or a query that returns a single long/integer value. Calling this on any other query could result in unexpected return values
     *
     * @return An Single that emits a long result
     */
    DBFlowSingle<Long> asCountSingle();

    /**
     * Creates an Single that emits a long value. This should be paired with {@link RxSQLite#selectCountOf(IProperty[])}
     * or a query that returns a single long/integer value. Calling this on any other query could result in an unexpected emitted
     * value
     *
     * @param databaseWrapper The database wrapper to use for the query
     * @return An Single that emits a long result
     */
    DBFlowSingle<Long> asCountSingle(DatabaseWrapper databaseWrapper);

    /**
     * Creates an Single that executes a SQL statement. This is usually used with CRUD statements as
     * it only emits a Void value
     *
     * @return An Single that executes a SQL statement
     */
    DBFlowExecuteCompletable asExecuteCompletable();