Class ScriptUtils

java.lang.Object
org.springframework.r2dbc.connection.init.ScriptUtils

public abstract class ScriptUtils extends Object
Generic utility methods for working with SQL scripts in conjunction with R2DBC.

Mainly for internal use within the framework.

Since:
5.3
Author:
Thomas Risberg, Sam Brannen, Juergen Hoeller, Keith Donald, Dave Syer, Chris Beams, Oliver Gierke, Chris Baldwin, Nicolas Debeissat, Phillip Webb, Mark Paluch
See Also:
  • invalid reference
    org.springframework.jdbc.datasource.init.ScriptUtils
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default end delimiter for block comments within SQL scripts: "*/".
    static final String
    Default start delimiter for block comments within SQL scripts: "/*".
    static final String[]
    Default prefixes for single-line comments within SQL scripts: ["--"].
    static final String
    Default statement separator within SQL scripts: ";".
    static final String
    End of file (EOF) SQL statement separator: "^^^ END OF SCRIPT ^^^".
    static final String
    Fallback statement separator within SQL scripts: "\n".
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static reactor.core.publisher.Mono<Void>
    executeSqlScript(Connection connection, org.springframework.core.io.Resource resource)
    Execute the given SQL script using default settings for statement separators, comment delimiters, and exception handling flags.
    static reactor.core.publisher.Mono<Void>
    executeSqlScript(Connection connection, org.springframework.core.io.support.EncodedResource resource)
    Execute the given SQL script using default settings for statement separators, comment delimiters, and exception handling flags.
    static reactor.core.publisher.Mono<Void>
    executeSqlScript(Connection connection, org.springframework.core.io.support.EncodedResource resource, org.springframework.core.io.buffer.DataBufferFactory dataBufferFactory, boolean continueOnError, boolean ignoreFailedDrops, String[] commentPrefixes, @Nullable String separator, String blockCommentStartDelimiter, String blockCommentEndDelimiter)
    Execute the given SQL script.
    static reactor.core.publisher.Mono<Void>
    executeSqlScript(Connection connection, org.springframework.core.io.support.EncodedResource resource, org.springframework.core.io.buffer.DataBufferFactory dataBufferFactory, boolean continueOnError, boolean ignoreFailedDrops, String commentPrefix, @Nullable String separator, String blockCommentStartDelimiter, String blockCommentEndDelimiter)
    Execute the given SQL script.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait