All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jasync.sql.db.interceptor.QueryInterceptor.kt Maven / Gradle / Ivy

package com.github.jasync.sql.db.interceptor

import com.github.jasync.sql.db.QueryResult
import java.util.concurrent.CompletableFuture

interface QueryInterceptor {

    /**
     * called before query executed
     * @param query that should be executed
     * @return the query that should be executed or a manipulation over it
     */
    fun interceptQuery(query: String): String

    /**
     * called with query result, allow to hook into result, change them or introspect them
     * @param result a future holding the result
     * @return the future holding the result or a manipulation over it
     */
    fun interceptQueryComplete(result: CompletableFuture): CompletableFuture

    /**
     * called before prepared statement executed
     * @param params that should be executed
     * @return the prepared statement that should be executed or a manipulation over it
     */
    fun interceptPreparedStatement(params: PreparedStatementParams): PreparedStatementParams

    /**
     * called with prepared statement result, allow to hook into result, change them or introspect them
     * @param result a future holding the result
     * @return the future holding the result or a manipulation over it
     */
    fun interceptPreparedStatementComplete(result: CompletableFuture): CompletableFuture
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy